AX – D365FO – X++ Code to Unsettle Payment and Invoice

This is small utility code if we need to unsettle payments and invoice Reference article : https://community.dynamics.com/ax/b/amirsaxspace/posts/x-code-to-unsettle-payment-and-invoice select firstonly * from findCustTrans where findCustTrans.Voucher == voucher; if (findCustTrans.RecId) { balanceAmount = findCustTrans.remainAmountCur(); if (balanceAmount == 0) { custTable = custTable::find(findCustTrans.AccountNum); select firstonly custSettlement where custSettlement.TransCompany == findCustTrans.dataAreaId && custSettlement.TransRecId == findCustTrans.RecId && custSettlement.AccountNum == findCustTrans.AccountNum; … Continue reading AX – D365FO – X++ Code to Unsettle Payment and Invoice