dynamics-ax-2009

How to pass a parameter between two forms in Axapta?

半世苍凉 提交于 2019-12-01 02:31:25
问题 How can i pass a single parameter between a form in axapta ? I want to run a Form B from a clicked button event in a Form A and pass... for example the customer id ? How can i read it in the destination form, maybe in the init method ? Thanks 回答1: 1 Method The easiest way is to pass current record. Just change button control's DataSource value for Example to CustTable if CustTable is in current Form data sources. Then in destination form init method: public void init() { CustTable cTable; ;

How to get the results of a direct SQL call to a stored procedure?

和自甴很熟 提交于 2019-12-01 02:19:27
问题 I'm calling a stored procedure via direct SQL from X++, and I can't figure out how to get the integer return value from it. 0 is good, -1 is bad. // Login to SQL DB loginProperty = new LoginProperty(); loginProperty.setServer('localhost'); loginProperty.setDatabase('SQL_DB'); odbcConnection = new OdbcConnection(loginProperty); statement = odbcConnection.createStatement(); /* @in_customer_id INT ,@status INT ,@dlvmode NVARCHAR(25) ,@dlvmodedesc NVARCHAR(50) ,@tracking_id NVARCHAR(50) ,@note

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

蓝咒 提交于 2019-11-29 08:00:22
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? 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 extension method public static string CurUserId(this Axapta ax) { return (ax.CallStaticClassMethod("xUserInfo

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

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