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.
Congratulations to our 2026 Super Stars!
We are thrilled to have these Champions in our Community!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Giorgio Bonacorsi 689
André Arnaud de Cal... 478 Super User 2026 Season 1
Syed Haris Shah 258 Super User 2026 Season 1