Wednesday, October 22, 2025

Get salestax amount of each individual purchline

 Scenario:- In this post we see how we can get salestax amount of a purchline from purchase order

code:-

PurchTable purchTable =PurchTable::find('00000400');
PurchTotals purchTotals = PurchTotals::newPurchTable(purchTable);
purchTotals.calc();
TmpTaxWorkTrans tmpTaxWorkTrans;
tmpTaxWorkTrans.setTmpData(purchTotals.tax().tmpTaxWorkTrans());

real salestax;

while select * from tmpTaxWorkTrans
     where tmpTaxWorkTrans.SourceRecId == Pass Purchlinerecid
{
     // Process the tax information for the specific line
     salestax+=tmpTaxWorkTrans.TaxAmount;
}

info(strfmt("SalesTaxamount:-%1",salestax));

No comments:

Post a Comment

Assign roles through ssms in d365fo

 Step1;- Here my Role name I want to assign is System admin SELECT  RecId,* FROM SecurityRole WHERE Name = 'System administrator'; s...