Work with a range in EP

An item I use frequently in the EP development, changing the query ranges from code behind.



The code snippet is like this:

....

        using (ApplicationProxy.Query appQuery = ApplicationProxy.EPTrv.projectLookup(worker, category, legalEntity))
        {
            Proxy.Query query = new Proxy.Query(this.AxSession.AxaptaAdapter,
                ApplicationProxyHelper.CastToObjectAdapter(this.AxSession, appQuery));

            Proxy.QueryBuildRange custAccountdRange = query.dataSourceNo(1).addRange(TableDataFieldMetadata.FieldNum(this.AxSession, "ProjTable", "CustAccount"));
            custAccountdRange.value = countryRegionID;
            custAccountdRange.status = (int)Proxy.RangeStatus.Locked;

            lookup.LookupDataSet.DataSetViews[0].MasterDataSource.query(query);
        }

        lookup.Fields.Clear();

No comments:

Post a Comment