Posts

Showing posts from June, 2016

MultiSelectionHelper - example

Hi, Please refer the below 2 class for MultiSelectionHelper example 1) SmaSubscriptionBase 2) smaSubscriptionCreate Thanks, Vijaykarthik

Custom lookup for Dialog fields - easy way

Hi, SysTableLookup can be used in dialogs to create custom lookups. control.registerOverrideMethod can be used to register the methods to override by an object Here is the example which shows basic usage of both. We will create a dialog and get a lookup of account numbers on a control protected Object dialog() {     FormStringControl control;     ;     dialog = super();     dialogFeildAccountNum = dialog.addField(extendedTypeStr(AccountNum));     control = dialogFeildAccountNum.control();     control.registerOverrideMethod(methodStr(FormStringControl, lookup), methodStr(DialogLookup, accountNumLookup ), this);         return dialog; } Here is the method: private void accountNumLookup(FormStringControl _control) {     SysTableLookup          sysTableLookup;     QueryBuildDataSource    queryBuildDataSource;     Query                   query = new Query();     queryBuildDataSource = query.addDataSource(tablenum(CustTable));     sysT

Refresh Parent Form after updating data in child form

Hi, when you want to refresh the parent form after updating data in child form, void click() { FormRun   fr; MenuFunction  mf; Args    args = new Args(); ; //super(); mf = new MenuFunction(menuitemdisplaystr('SalesTable'),MenuItemType::Display); args.record(SalesLines); fr = mf.create(args); fr.run(); fr.wait(true); SalesLine_ds.reread(); SalesTable_ds.research(true); //true value is important } (or) if (this.parmArgs() &&     this.parmArgs().record() &&     this.parmArgs().record().dataSource()) {     formDataSource = this.parmArgs().record().dataSource();     formDataSource.reread();     formDataSource.research(true); }