Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

AX method

Posted on by 75

Dear all!

I am using AX 2012 and have some function of stored procedures to output file to linkage to other system.

Basically , output file include collected data of AX transactions and stored procedure is executed from ~month to~month .

I have AX screen menu to execute stored procedure.

From screen, give parameter1(start month) and parameter2(end parameter) and call 2 stored procedures.

but , when I execute , the process of the program didn't finished, but when stored procedure program is executed from SQL server management studio, the process is finished. 

I used executeUpdate()method to execute stored procedure from screen.

Is there any other method to execute stored procedure or any other batch not from screen, but from any other way, like separately executed from screen.

Here is my source:

else if(subStr(param,13,8) == 'AXXXXXX1')
#
{
# sql = builder.ToString();
# sql = strDel(sql,strLen(sql),1);
#
# Conn = new Connection();
# Stmt = Conn.createStatement();
# sqlPermission = new SqlStatementExecutePermission(sql);
# sqlPermission.assert();
#
# try
# {
#
# Stmt.executeUpdate(sql);
# }
# catch (exception::Error)
# {
# throw error('@SYS99562');
# }
#
# CodeAccessPermission::revertAssert();
#
# sql = builder.ToString();
# sql = 'Exec AXXXXXX2' + subStr(sql,14,18);
#
# Conn = new Connection();
# Stmt = Conn.createStatement();
# sqlPermission = new SqlStatementExecutePermission(sql);
# sqlPermission.assert();
#
# try
# {
#
# Stmt.executeUpdate(sql);
# }
# catch (exception::Error)
# {
# throw error('@SYS99562');
# }
#
# CodeAccessPermission::revertAssert();
#
# }

*This post is locked for comments

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans