Notifications
Announcements
No record found.
class DTInventlocationidlookupEventhandler { /// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> [FormEventHandler(formStr(InventLocationIdLookup), FormEventType::PostRun)] public static void InventLocationIdLookup_OnPostRun(xFormRun sender, FormEventArgs e) { Args args = new args(formstr(InventLocationIdLookup)); Container LocationId; FormRun formRun = sender; FormRun callerForm = sender.args().caller(); //TableId callerTableId = sender.args().dataset(); //common common = sender.args().record(); FormDataSource SalesLine_ds,InventDim_ds,SalestableInventDim_ds; UserId userId = curUserId(); DTUserInfo dtUserInfo; InventLocation inventLocation; DTSalesTransactionAccess salesTranAccess,salesTranAccess1; InventDim inventDim,inventDimLoc; var overrideds = new DTInventlocationidlookupEventhandler(); // InventDim_ds = formRun.dataSource(formDataSourceStr(InventLocationIdLookup, InventDim)); SalesLine_ds = callerForm.dataSource(formDataSourceStr(SalesTable, SalesLine)); SalestableInventDim_ds = callerForm.dataSource(formDataSourceStr(SalesTable, InventDim)); SalesLine salesLine = SalesLine_ds.cursor(); inventDim = SalestableInventDim_ds.cursor(); select firstonly InventLocation where inventLocation.InventLocationId == inventDim.InventLocationId; args.record(InventLocation); formrun = classfactory.formrunclass(args); ; select firstonly salesTranAccess where salesTranAccess.UserId == userId && salesTranAccess.Stock == NoYes::Yes && salesTranAccess.inventLocationId == inventDim.InventLocationId && salesTranAccess.UserId == salesLine.CreatedBy; if( salesTranAccess.RecId != 0 ) { while select * from salesTranAccess where salesTranAccess.UserId == userId && salesTranAccess.Stock == NoYes::Yes { LocationId += salesTranAccess.inventLocationId; } str invLocationId = con2Str(LocationId,","); formRun.query().dataSourceName(formDataSourceStr(InventLocationIdLookup,InventLocation )).addRange(fieldNum(InventLocation, InventLocationId)).value(invLocationId); // InventDim_ds.query().dataSourceTable(Tablenum(InventLocation)).addRange(fieldnum(InventLocation, InventLocationId)).value(invLocationId); } } }
[ExtensionOf(formDatasourceStr(InventLocationIdLookup, InventLocation))] final class InventLocationIdLookup_InventLocationDS_Extension { public void executeQuery() { QueryBuildDataSource qdbs; next executeQuery(); qdbs = this.query().dataSourceTable(Tablenum(InventLocation)); // your code qdbs.addRange(fieldnum(InventLocation, InventLocationId)).value(...); } }
[ExtensionOf(formDatasourceStr(InventLocationIdLookup, InventLocation))] final class DTInventLocationIdLookup_InventLocationDS_Extension { public void executeQuery() { QueryBuildDataSource qdbs; next executeQuery(); FormRun formrun = this.formRun().args().caller(); FormDataSource SalesLine_ds,InventLocation_ds,SalestableInventDim_ds; UserId userId = curUserId(); DTUserInfo dtUserInfo; InventLocation inventLocation; DTSalesTransactionAccess salesTranAccess,salesTranAccess1; Common common; InventDim inventDim; Container LocationId; common = formrun.dataSource(formDataSourceStr(SalesTable, SalesLine)).cursor(); inventDim = formrun.dataSource(formDataSourceStr(SalesTable, InventDim)).cursor(); select firstonly inventLocation where inventLocation.InventLocationId == inventDim.InventLocationId; ; select firstonly salesTranAccess where salesTranAccess.UserId == userId && salesTranAccess.Stock == NoYes::Yes && salesTranAccess.inventLocationId == inventDim.InventLocationId && salesTranAccess.UserId == common.CreatedBy; if( salesTranAccess.RecId != 0 ) { while select * from salesTranAccess where salesTranAccess.UserId == userId && salesTranAccess.Stock == NoYes::Yes { LocationId += salesTranAccess.inventLocationId; } str invLocationId = con2Str(LocationId,","); qdbs = this.query().dataSourceTable(Tablenum(InventLocation)); // your code qdbs.addRange(fieldnum(InventLocation, InventLocationId)).value(invLocationId); } } }
[ExtensionOf(formStr(InventLocationIdLookup))] final class InventLocationIdLookup_Extension { void init() { next init(); InventLocation_ds.executeQuery(); } }
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 646 Most Valuable Professional
André Arnaud de Cal... 529 Super User 2025 Season 2
Sohaib Cheema 285 User Group Leader