Skip to main content

Posts

Split string useing List in AX2009

static void Job277(Args _args) {     List _list = new List(Types::String);     Container packedList;     ListIterator iterator;     str cade = "Jhon*,smt*,and*,caro*";     ;     _list = Global::strSplit(cade,",");     iterator = new ListIterator(_list);     while(iterator.more())     {         packedList += iterator.value();         iterator.next();     }     info(conpeek(packedList,2));     info(strfmt("%1",conlen(packedList)));   }

X++ code to Sending email using code and data with table format

static void SendEmail(Args _args) {     SysEmailParameters parameters = SysEmailParameters::find();     SMTPRelayServerName relayServer;     SMTPPortNumber portNumber;     SMTPUserName userName;     SMTPPassword password;     Str subject,body;     InteropPermission interopPermission;     SysMailer mailer;     System.Exception e;     str s;     CCHTMLString             htmlString;     ;     if (parameters.SMTPRelayServerName)     relayServer = parameters.SMTPRelayServerName;     else     relayServer = parameters.SMTPServerIPAddress;     portNumber = parameters.SMTPPortNumber;     userName = parameters.SMTPUserName;  ...

AX2009 How to get Item default order settings ...

static void ItemDefaultDimensions(Args _args) {     InventTable                 inventTable = inventTable::find('000367');     InventItemOrderSetupType    setupType   = InventItemOrderSetupType::Sales;     InventDim                   inventDim;     ;     inventDim.InventSiteId = inventTable.inventItemOrderSetupMap(setupType).inventSiteId('2', inventTable);     inventDim.InventLocationId  = inventTable.inventItemOrderSetupMap(setupType,InventDim::findOrCreate(inventDim).InventDimId).inventLocationId(inventDim.InventLocationId,inventTable,'2');                                                                           ...

AIF (Endpoint) Error : The user is not authorized to perform this action.

"The user is not authorized to perform this action."  We started getting this error message in our AX 2009 System, when ever we try to consume an XML file using an  Endpoint   thru a  File System  Channel to create a  Sales Order. We did not made any code changes / setup changes, but all of the sudden started getting this error. Solutions : 1. Validate the "SourceEndpointUser". in inbound XML  The User ID should be a valid user Id in DAX, in GNS Active Directory and the "\" should be back slash in the XML file or where you use this combination in entire process or setup. ex : Domain \ User Id. In our case when we had the above error, the SourceEndPointUser user id was deleted from the Active Directory in GNS, so we added it back to Active Directory then it solved the problem. NOTE : If nothing wrong with the User ID, try to add the user id in "Users" tab in Endpoints form for that End Point used by the process. 2. Verify th...

How to fix AX 2009 AIF Service Operation error "there is no schema associated with the specified class."

We usually get this error message when we do a data refresh from PROD to TEST / QA or DEV environments. The Schema document for AIF Service Operations stored in a table called "AifSchemaStore" and  the reference data stored in "AifDocumentSchemaTable". 1. AifDocumentSchemaTable : - https://msdn.microsoft.com/en-us/library/aifdocumentschematable.aspx 2. AifSchemaStore : - https://msdn.microsoft.com/en-us/library/aifschemastore.aspx So when we do a data refresh I think sometimes the refRecid's wont synch (Which is happened in my environment). Fix : So I found the record in AifDocumentSchemaTable using the AIF ClassId and deleted that record, then I re generated the service (Basic >> Setup >> AIF >> Service >> Click on Generate. It recreated the new schema and stored in the AifSchemaStore and linked to AifDocumentSchemaTable record. Then everything worked fine. Note : This will also adds the service in Configuration screen t...

How to identify the AOS server name /Instance Name In Axapta

Hi Folks, Here is the code to identify the AOS server name /Instance Name In Axapta. static void JobForAOSSeververInstantname(Args _args) {     xSession curSession;     SysClientSessions clientSessions;     SysServerSessions serverSessions;     int usrSessionId;     int serverId;     str aosId;     str instanceName;     ;     curSession = new xSession();     usrSessionId = curSession.sessionId();     select firstonly ServerId from clientSessions where clientSessions.SessionId == usrSessionId;     serverId = clientSessions.ServerId;     select firstonly * from serverSessions where serverSessions.ServerId == serverId;     aosId = serverSessions.AOSId;     instanceName = serverSessions.Instance_Name;     info(instanceName); } Thanks, Brahma

Error : Target file should be in UNC format – in batchprocess run in server ax2009

Hi Friends, Error:  Target file should be in UNC format – in batch process run in server ax2009. Normally we will get this error on batch process .I.e. when we run the report on screen and save the file in particular location /Email .The file will be saved in location with out any errors . But when we do the same process on Batch .we will get this type of error. Because in batch process, we will select the specific path to save the report, that particular path AOS Server couldn't able to identify the location. That time we will get this type of error. To solve this error, we need to create the folder in the location that location is accessible for all the users and as well as AOS Server also having the rights to access that path and run the bath again.    Thanks, Happy Daxing …