Tuesday, March 15, 2022

X++ to get GST Amount in D365F&O





To Get GST Amount in Dynamics 365 F&O through X++ Code

public Amount GetGSTAmount(str type)
{
TaxDocumentRowTransaction TaxDocumentRowTransaction;
TaxDocumentComponentTransaction TaxDocumentComponentTransaction;
TaxComponentTable_IN component.
TaxDocumentComponentTransaction_In taxDocumentComponentTransactionIn;
select sum (TaxAmount) from TaxDocumentComponentTransaction
exists join TaxDocumentRowTransaction
where TaxDocumentRowTransaction.RecId == TaxDocumentComponentTransaction.TaxDocumentRowTransactionRecId
&& TaxDocumentRowTransaction. Voucher == this. Voucher
&& TaxDocumentRowTransaction.InvoiceId == this.CustomerInvoiceNo
&& TaxDocumentRowTransaction.TransactionDate == this.CustomerInvoiceDate
exists join taxDocumentComponentTransactionIn
where taxDocumentComponentTransactionIn.TaxDocumentComponnetTransactionRecId == TaxDocumentComponentTransaction.RecId
exists join component where component.RecId == taxDocumentComponentTransactionIn.TaxComponent
&& component.TaxType == TaxType_IN::GST
&& component. Component == type;

return TaxDocumentComponentTransaction.TaxAmount;
}

1 comment:

  1. Thanks for your blog. This is the critical development for mine. You made my day. Your blog is saved my job. Thanks once again. Keep post all the development codes.

    ReplyDelete