axapta

AX2009 Loop through all the controls in the form on init

。_饼干妹妹 提交于 2019-11-28 14:02:56
How is it possible to loop through all the controls in a form when a form is initialized? I have tried the following in the init and run methods, but it does not work: for( i = 1 ; i <= element.form().design().controlCount() ; i++ ) { control = element.form().design().controlNum(i); switch ( control.handle() ) { case classnum(FormBuildButtonControl): element.initButton(control); break; case classnum(FormBuildStaticTextControl): element.initStaticText(control); break; } } Is there any way of doing this? The code you have works, but it only iterates through the top level of the design. You need

Are RecIds unique across Common tables in Dynamics AX 2012?

时间秒杀一切 提交于 2019-11-28 06:00:07
问题 Are the RecIds unique across Common tables in AX 2012? I read that this is version dependent, but I did not manage to find any information on this for AX 2012. If not, doesn't that break polymorphic design of the tables in AX, where all AX tables extend from Common ? And Common declares RecId ... 回答1: When Microsoft Dynamics AX inserts records into SQL tables, a unique RecId is assigned to each record regardless of the company each record is associated with. The field is 64 bit long and

How to catch inner exception?

放肆的年华 提交于 2019-11-28 03:33:33
问题 Is there any possibility to catch inner exception: try { ttsbegin; info("step one"); try { info("step two"); throw Error("error"); } catch { info("catch step two"); } ttscommit; } catch { info("catch step one"); ttsabort; } I know I can get it commenting ttsbegin; / ttscommit, but I need to have a transaction. 回答1: No, it is not possible (unless your exception is UpdateConflict or DuplicateKeyException ). The documentation states: If an exception is thrown inside a transaction, the

In Dynamics AX, using the Business Connector, how do you call kernel functions?

核能气质少年 提交于 2019-11-28 01:24:03
问题 I would like to know how to call kernel functions from AX using C# (.Net Business Connector). Specifically, can you call methods like fieldName2Id, tableName2Id and curUserId? 回答1: I found some workarounds to calling kernel functions: tableName2Id (I was originally thinking of the tablenum method): //I used an extension method here public static int GetTableId(this Axapta ax, string tableName) { return (int)ax.CallStaticClassMethod("Global", "tableName2Id", tableName); } curUserId //Another

What handles dynamics:// URLs?

坚强是说给别人听的谎言 提交于 2019-11-27 15:18:30
I'm trying to create my own custom drilldown functionality, where a URL dynamics://0?myfunction_123456 will launch my own code. In C\SysStartupCmd\construct , this base code: case 'viewalert': sysStartupCmd = new SysStartUpCmdViewAlert(s,parm); break; case 'drilldown': sysStartupCmd = new SysStartUpCmdDrillDown(s,parm); break; case 'viewalertrule': sysStartupCmd = new SysStartUpCmdViewAlertRule(s,parm); break; I've tested and these all get fired with these URLs: dynamics://0/?DrillDown_382576 dynamics://0/?ViewAlert_382576 dynamics://0/?ViewAlertRule_382576 However, if I add my own case,

AX2009 Loop through all the controls in the form on init

女生的网名这么多〃 提交于 2019-11-26 23:37:53
问题 How is it possible to loop through all the controls in a form when a form is initialized? I have tried the following in the init and run methods, but it does not work: for( i = 1 ; i <= element.form().design().controlCount() ; i++ ) { control = element.form().design().controlNum(i); switch ( control.handle() ) { case classnum(FormBuildButtonControl): element.initButton(control); break; case classnum(FormBuildStaticTextControl): element.initStaticText(control); break; } } Is there any way of