Look up and passing ranges in enterprise portal

protected void PriorApp_LookUp(object sender, AxLookupEventArgs e)
{
string Employee;
// AxBoundField boundField = (AxBoundField)sender;

AxLookup lookup = e.LookupControl;
using (Proxy.SysDataSetBuilder sysDataSetBuilder = Proxy.SysDataSetBuilder.constructLookupDataSet(this.AxSession.AxaptaAdapter, TableMetadata.TableNum(this.AxSession, "TrvExpTable")))
{
// Set the run time generated data set as the lookup data set
lookup.LookupDataSet = new Microsoft.Dynamics.Framework.Data.Ax.DataSet(this.AxSession, sysDataSetBuilder.toDataSet());
}


Employee = ApplicationProxy.TrvExpTable.EmployeeEP(this.AxSession.AxaptaAdapter, this.ExpNumber);
// Filter the lookup to only display acceptable account types
using (Proxy.Query query = lookup.LookupDataSet.DataSetViews[0].MasterDataSource.query())
{
// query.dataSourceNo(1).addRange(TableDataFieldMetadata.FieldNum(this.AxSession, "TrvExptable", "txt2")).value = Label_Purpose.Text;
query.dataSourceNo(1).addRange(TableDataFieldMetadata.FieldNum(this.AxSession, "TrvExptable", "Employee")).value = Employee;
query.dataSourceNo(1).addRange(TableDataFieldMetadata.FieldNum(this.AxSession, "TrvExptable", "asu_TypeOfRequest")).value = "1";
query.dataSourceNo(1).addRange(TableDataFieldMetadata.FieldNum(this.AxSession, "TrvExptable", "ApprovalStatus")).value = "3";
}
}

Comments

Post a Comment

Popular posts from this blog

Running runnable class through URL in Dynamics 365 for Operations

D365FO Use of FileUpload control to Read CSV file

D365FO Send Report as email attachment