Skip to main content

Posts

Showing posts with the label role

Code to get customer Primary Address in Ax 2012

Below Code to get customer Primary Address in Ax 2012. CustTable custTable_P; DirPartyTable dirPartyTable_P; DirPartyLocation dirPartyLocation_P; DirPartyLocationRole dirPartyLocationRole_P; LogisticsLocation logisticsLocation_P; LogisticsLocationRole logisticsLocationRole_P; LogisticsPostalAddress logisticsPostalAddress_P; LogisticsPostalAddress primaryAddress_P; while select custTable_P where custTable_P.AccountNum =='ED_01029' join dirPartyTable_P where dirPartyTable_P.RecId == custTable_P.Party join dirPartyLocation_P where dirPartyLocation_P.Party == custTable_P.Party && dirPartyLocation_P.IsPrimary==NoYes::Yes join dirPartyLocationRole_P where dirPartyLocationRole_P.PartyLocation == dirPartyLocation_P.RecId join logisticsLocationRole_P where logisticsLocationRole_P.RecId == dirPartyLocationRole

Concept of exception handling in X++ programming MSDAX

Main idea behind exception handling in X++ programming The main idea behind exception handling is to plan for potential pitfalls within the program. These exceptions are inevitable and if the code can expect some of these issues and have contingency plans for the code, the flow of the program is more efficient. The try statement defines a block of code that is included in the try-catch statement. It is used as the point to which the logical program flow will return should it encounter a retry command. The throw statement automatically initiates a ttsAbort statement every time that it is called. The throw statement will force the current transaction to roll back to its original state before the ttsBegin statement.