Posts

How to refresh list page and do not lost focus in grid?

I opened detail form in list page grid. I have done some changes in the detail form(say added the qty, changed the unit price..etc), while close() the form I am refreshing the list page grid (only the selected record. it increase the performance rather refresh all records in the grid)    FormDataSource   callerDataSource;    int                          position;   if (element.args().record())   {        callerDataSource = element.args().record().dataSource();          position               = callerDataSource.getPosition();        callerDataSource.reread();                callerDataSource.refreshEx(position); //To refresh the specific record in the list page       //if you want to refresh all records in the list page,(comment refreshEx() call above)        /*callerDataSource.research(true);        callerDataSource.setPosition(position); */   } Thanks, Vijaykarthik

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); }

Blank Page Issues – SSRS Reports

Hi, Refer the below link to resolve the blank page printing in SSRS reports of ax 2012 https://stoneridgesoftware.com/blank-page-issues-ssrs-reports/

Management Reporter 2012 Security Review with AX 2012

Hi, Please refer the below link to assign the permission in MR from ax 2012. https://blogs.msdn.microsoft.com/axinthefield/2015/02/02/management-reporter-2012-security-review-with-ax-2012/

Find Active Dimensions for a Legal Entity in Ax2012

Hi, Please use the below code to find the active dimension by legal entity. it will be useful when we do data upload. static void getActiveFinancialDimensions(Args _args) {     DimensionAttributeSetItem   dimAttrSetItem; // Contains the number of dimensions active for a account structure ledger     DimensionAttribute          dimAttr; // Contains the financial dimensions records     DimensionEnumeration        dimensionSetId; //Record id for table that contains active dimensions for current ledger         int dimAttrCount;         //Get the record Id (dimension set id) for current ledger to find active dimensions     dimensionSetId = DimensionCache::getDimensionAttributeSetForLedger();       //Find the count of active dimensions for current ledger except main account     select count (RecId) from dimAttr             where dimAttr.Type != DimensionAttributeType::MainAccount         join RecId from dimAttrSetItem             where dimAttrSetIt