Hi all,
i use AX 2012.
In this https://msdn.microsoft.com/en-us/library/cc622853(v=ax.50).aspx you can read how easily you can call a X++ method.
But here is the Problem. Here is my test method:
[DataMethod(), PermissionSet(SecurityAction.Assert, Name = "FullTrust")]
public static string getDateFormat(string date)
{
AxaptaWrapper axapta = SessionManager.GetSession();
return date + " ja";
}
Here i became a warning: "The SessionManager.GetSession method is obsolete. The ability to use Business Connector .NET from report data methods will be removed in a future version of Microsoft Dynamics AX."
The result of this is that i can use the method in the report, but everywhere i use this i get "#error" in runtime. When i commit out this line, no error is shown.
The other opportunity is to use this:
[DataMethod(), PermissionSet(SecurityAction.Assert, Name = "FullTrust")]
public static string getDateFormat(string date)
{
AxaptaWrapper axapta = SessionManager.CreateSession();
return date + " ja";
}
But here the compiler shows an error: "'Microsoft.Dynamics.Framework.Reports.SessionManager.CreateSession()' is inaccessible due to its protection level"
So what I have to do in AX 2012 to call a static AX method?
*This post is locked for comments
I have the same question (0)