Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / Updating currency in v...
Finance forum
Unanswered

Updating currency in vendor invoice header (VendInvoiceInfoTable) through X++

Posted on by 6
Standard: During broker claim process, vendor invoice will be created with accounting currency. 
Requirement : The vendor invoice should be created with transaction currency (Salestable.Currency).
 
My code : 
[ExtensionOf(classStr(MCRBrokerVendInvoice))]
public void createVendorInvoice(MCRBrokerClaim _mcrBrokerClaim)
{
SalesTable salesTable;
next createVendorInvoice(_mcrBrokerClaim);
 
select salesTable where ......XXXX;
 
//Logic to update header currency
 ttsbegin;
 vendInvoiceInfoTable.CurrencyCode = salesTable.CurrencyCode;
 vendInvoiceInfoTable.update();
 ttscommit;
 
//Logic to update lines currency 
{
}
 
}
 
Problem : when I run this code, iam getting this warning -
////
Becoz there is validation in standard  vendInvoiceInfoTable.update() logic. And Iam afraid to bypass the logic by using doUpdate().
Is there any best way to overcome this problem ?

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,277 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,126 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans