Nice post that describes how to send e-mails using e-mail templates : https://dynamicsaxinsight.com/2019/01/30/d365-send-email-in-xpp-using-email-templates/
AX / D365FO – Convert UTCDateTime to Date
In this example I will convert UTCDateTime type into Date type date myDate = DatetimeUtil::Date(MyUTCDateTime)
AX / D365FO – Set a default value of a table field when creating a new row
To set a default value of a table field just use the initValue() method of the table [ExtensionOf(tableStr(CustTable))] final class CustTable_Table_Extension { void initValue() { next initValue(); this.yourField = 1234 //set your new custom field's default value. }
AX / D365FO – Get current user email
Get the current logged user e-mail UserInfo userInfo; str email; select firstonly userInfo where userInfo.Id == curUserId(); email = userInfo.networkalias
AX / D365FO – Create a new Purpose for Address or COntact
To create a new purpose go to Organization administration > Global address book > Address and contact information purpose Click New To add a new purpose, click New, and then enter the name of the purpose and a brief description. Then select the Postal address or Contact information check box to specify whether the purpose is used for address records … Continue reading AX / D365FO – Create a new Purpose for Address or COntact
AX / D365FO – Split string into Array
I have a text that which contains comma separated values and I want to insert values into an array. You can use strSplit() method to do this public void splitString(str _splitString) { List strlist = new List(Types::String); ListIterator iterator; str _Value; strlist = strSplit(_splitString,”,”); iterator = new ListIterator(strlist); while(iterator.more()) { _Value = iterator.value(); iterator.next(); } … Continue reading AX / D365FO – Split string into Array
AX / D365FO – Creating Email Body with Dynamic Table (with Docentric free edition)
With Docentric AX Free Edition you can: use an advanced HTML editor to format email bodies within D365FO, pick a placeholder from a list of available placeholders for the current email, if you need to create a dynamic email body. Read this article to learn how : https://ax.docentric.com/improved-email-templates-creating-email-body-dynamic-table/?toolbarclose=yes
AX / D365FO – Remove spaces from Text in Ax (TRIM)
To Remove spaces from Text you can get idea from below code sample. Here we are update name fields which include spaces on right and left side . Dirpartytable Dirpartytable; Name Name; ; while select forUpdate Dirpartytable { ttsBegin; Name= strRTrim(strLTrim(Dirpartytable.Name)); Dirpartytable.Name = Name; Dirpartytable.doUpdate(); ttsCommit; } info("Done");
AX / D365FO – Error : “Connection is busy with results for another hstmt” while executing a stored procedure
With AX you have the ability to execute stored procedures directly from X++ code The benefit is greater speed in query execution and flexibility in building complex queries. See this post to learn more about the topic : https://dynamicsaxgyan.wordpress.com/2020/03/06/create-and-execute-stored-procedures-in-d365-fo-x/ I recently encountered this error in a procedure that executes a SQL stored procedure : "Connection … Continue reading AX / D365FO – Error : “Connection is busy with results for another hstmt” while executing a stored procedure
AX / D365FO – How to : “Serialization version mismatch detect, make sure the runtime dlls are in sync with the deployed metadata D365 For finance and operations”
I got this error after made some changes to a report Error : Serialization version mismatch detect, make sure the runtime dlls are in sync with the deployed metadata D365 For finance and operations To solve the issue just make a full rebuild of your custom model