web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Apply GST by X++ during Sales order import

(0) ShareShare
ReportReport
Posted on by 1,330

Hi,

I have a customized sales order import (CSV file import) batch job. it works find and creates sales orders with lines. It was created long back.

Now i have a new column in CSV file for GST amount. I need to apply the GST amount for the sales order instead of it calculating based on the Tax codes configured(standard AX calculation).

Can anyone please let me know how do i do it in x++ ?

Appreciate the help. Thanks.

*This post is locked for comments

I have the same question (0)
  • Dick Wenning Profile Picture
    8,705 Moderator on at

    GST is??

  • mail2vd Profile Picture
    1,330 on at

    It's a Tax on the net amount of the sales order.

    net amount + GST (tax) = Gross Amount

  • Dick Wenning Profile Picture
    8,705 Moderator on at

    does the create line function not do it all?

    salesLine.SalesId = salesTable.SalesId;

    salesLine.ItemId = '1205';

    salesLine.createLine(true, true, true, true, true, true);

    server void  createLine(boolean              _validation                  = false,

                           boolean              _initFromSalesOrderTable     = false,

                           boolean              _initFromItemOrCategory      = false,

                           boolean              _calcInventQty               = false,

                           boolean              _searchMarkup                = true,

                           boolean              _searchPrice                 = false,

                           boolean              _checkReservation            = false,

                           boolean              _skipCreditLimitCheck        = false,

                           InventTransId        _oldInventTransId            = '',

                           boolean              _ignoreSalesTableInventDim   = false,

                           boolean              _setLineNum                  = true,

                           boolean              _searchAgreementLine         = false,

                           SMAServiceOrderTable _smaServiceOrderTable        = null)

    {

  • mail2vd Profile Picture
    1,330 on at

    Sales createline does it as a standard way by looking into the configuration of tax. so if your sales is let's say 100$ and GST is configured as 10% , total amount would be 110$.

    but in my case, i don't want to read tax percentage from configuration. I want to straight away put tax amount in calculation and i want it per sales order and not for each individual sales line.

  • Dick Wenning Profile Picture
    8,705 Moderator on at

    start debugging :-(

    I assume that you have to create a derived class from one of below

    tree.PNG

  • mail2vd Profile Picture
    1,330 on at

    what if I use below code after sales order gets created?

    TaxTmpWorkTransForm taxTmpWorkTransForm = TaxTmpWorkTransForm::construct();

    taxTmpWorkTransForm.init();

    tax = new Tax();

    taxTmpWorkTransForm.initTax(tax, tableNum(SalesTable),salesTable,null,null);

    taxTmpWorkTransForm.applyTaxAdjustments(tableNum(SalesTable),salesTable);

  • Dick Wenning Profile Picture
    8,705 Moderator on at

    test and see what happens, I have no idea

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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans