Notifications
Announcements
No record found.
Has anyone ever had to split amounts on two or more ledger dimensions in vendor invoice line by x++? If so, could you please tell me how to proceed?
*This post is locked for comments
I have found the following solution for the issue :
ttsBegin;
while select //Every line that you want to add in distribution
{
accountingDist.clear();
accountingDist.AccountingDate = AccountingDate;
accountingDist.AccountingLegalEntity = AccountingLegalEntity;
accountingDist.AllocationFactor = AllocationFactor;
accountingDist.AmountSource = AmountSource;
accountingDist.LedgerDimension = LedgerDimension;
accountingDist.MonetaryAmount = MonetaryAmount;
accountingDist.Number = Number;
accountingDist.ReferenceRole = ReferenceRole;
accountingDist.Role = Role;
accountingDist.TransactionCurrency = TransactionCurrency;
accountingDist.TransactionCurrencyAmount = TransactionCurrencyAmount;
accountingDist.Type = Type;
accountingDist.SourceDocumentHeader = vendInvoiceInfoLine.vendInvoiceInfoTable().SourceDocumentHeader;
accountingDist.SourceDocumentLine = vendInvoiceInfoLine.SourceDocumentLine;
accountingDistCorrigee.insert();
}
sourceDocumentLine.AccountingStatus = SourceDocumentLineAccountingStatus::PartlyDistributed;
sourceDocumentLine.update();
ttsCommit;
Hi MozaikAX,
Thanks for this information but I need to distribute amount for purchase order line using x++.
If you could help me ?
what about the percentage?? how we can distribute it?
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Priya_K 4
Martin Dráb 4 Most Valuable Professional
MyDynamicsNAV 2