axapta

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

时间秒杀一切 提交于 2019-12-01 05:14:58
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 NVARCHAR(MAX) ,@modified SMALLDATETIME = null ,@override_email NVARCHAR(200) = null */ sqlStatement =

How to pass a parameter between two forms in Axapta?

心不动则不痛 提交于 2019-12-01 04:45:38
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 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; ; super(); // Check for passed arguments if( element.args() ) { // get record parameter if( element.args()

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

Can't catch exception inside AIF service

℡╲_俬逩灬. 提交于 2019-12-01 00:31:46
I have created an AIF service in dynamics AX 2012, when I tested it by calling the entrypoint method from a job, it worked fine, but when it is deployed en the calls are comming from the soap UI, it crashes inside with an error: "Unhandled esception". While debugging I found out the unhandled exception is thrown inside my catch clause of my try catch statement. It gets inside the catch because the method I am calling inside the try clause thows an error. So does anyone know why I can catch thrown error when I am running the code on client using the job, but can't catch it while it runs in CIL

How to set a single dimension value in AX 2012?

怎甘沉沦 提交于 2019-11-30 14:56:05
问题 My problem is setting some dimension values read from an external source. Given the AX 2009 statement: ledgerJournalTrans.Dimension = ledgerTable.Dimension; ledgerJournalTrans.Dimension[1] = "abc"; What is the equivalent way to that in AX 2012? This will of cause assume the existence of a "Department" dimension as the first dimension. 回答1: First things first, the legacy dimensions in AX 2009 have been completely redone and replaced in AX 2012. The new LedgerDimension are a combination of the

How to set a single dimension value in AX 2012?

﹥>﹥吖頭↗ 提交于 2019-11-30 12:59:21
My problem is setting some dimension values read from an external source. Given the AX 2009 statement: ledgerJournalTrans.Dimension = ledgerTable.Dimension; ledgerJournalTrans.Dimension[1] = "abc"; What is the equivalent way to that in AX 2012? This will of cause assume the existence of a "Department" dimension as the first dimension. dlannoye First things first, the legacy dimensions in AX 2009 have been completely redone and replaced in AX 2012. The new LedgerDimension are a combination of the account and the old dimension values that are needed based on the account structure and advanced

Are RecIds unique across Common tables in Dynamics AX 2012?

我的梦境 提交于 2019-11-29 12:08:05
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 ... 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 unique per table. In Axapta 3.0 and below RecIds were unique per company account and 32 bit long. Thus a company

How to catch inner exception?

对着背影说爱祢 提交于 2019-11-29 09:59:10
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. No, it is not possible (unless your exception is UpdateConflict or DuplicateKeyException ). The documentation states: If an exception is thrown inside a transaction, the transaction is automatically aborted (a ttsAbort operation occurs). This applies both for exceptions thrown manually

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