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)

HSN code against GST

(0) ShareShare
ReportReport
Posted on by 313

Hi,

How to fetch the HSN code against GST % in code. Please suggest me.

Thanks,

*This post is locked for comments

I have the same question (0)
  • Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hi,

    Can you please let us know what the HSN code is and in which country/region this is required?

    What do you want to fetch here exactly?

    Many thanks and best regards,

    Ludwig

  • Prabakaran.R Profile Picture
    313 on at

    Hi Ludwing,

    I have item against HSN code . I need to fetch GST rate and amount against HSN code.

    Thanks,

  • Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Good Morning Prabakaran.R,

    For which country/region do you require this code?

    That is, what is the country/region of the legal entity in which you made the tax setup?

    Best regards,

    Ludwig

  • Vignesh Babu S Profile Picture
    5 on at

    You can use the below code to fetch the HSN level GST component tax percentage(CGST,SGST,IGST). We shall pass the HSN code of the Item along with GST component eg.”IGST”, as parameters and can fetch respective GST percentage values..

    public static TaxRuntimeTaxMeasureValue getgstvalue (HSNCode_IN _code ,str _gstcomponent)

       {

           TaxRuntimeDocComponentMeasure          taxRuntimeDocComponentMeasure;

           TaxRuntimeLookupCondition              taxRuntimeLookupCondition;

           TaxRuntimeLookupVersion                taxRuntimeLookupVersion;

           TaxRuntimeDocComponent                 taxRuntimeDocComponent;

           TaxRuntimeLookup                       taxRuntimeLookup;

           TaxSolutionScope                       taxSolutionScope;

           TaxRuntimeDocContext                   taxRuntimeDocContext;

           TaxRuntimeDocContextVersion            taxRuntimeDocContextVersion;

           TaxRuntimeLookupMeasureResult          taxRuntimeLookupMeasureResult;

           TaxRuntimeLookupMeasureResultDetail    taxRuntimeLookupMeasureResultDetail;

           HSNCode_IN code;

           TaxSolutionScopeSetup  taxSolutionScopeSetup =  TaxSolutionScopeSetup::findByLedger(Ledger::current());

           select taxSolutionScope

               join taxSolutionScopeSetup

                  where taxSolutionScopeSetup.TaxSolutionScope == taxSolutionScope.RecId

               join taxRuntimeDocContext

                  where taxRuntimeDocContext.TaxSolutionScope == taxSolutionScope.RecId

                    && taxRuntimeDocContext.Solution == taxSolutionScope.Solution

               join taxRuntimeDocComponent

                  where taxRuntimeDocComponent.DocContext == taxRuntimeDocContext.RecId

               join taxRuntimeDocContextVersion

                  where taxRuntimeDocContextVersion.SolutionVersion == taxSolutionScope.SolutionVersion

                        && taxRuntimeDocContextVersion.TaxRuntimeDocContext == taxRuntimeDocContext.RecId;      

           select taxRuntimeLookupVersion

                 where taxRuntimeLookupVersion.DocContextVersion ==  taxRuntimeDocContextVersion.RecId

                join taxRuntimeLookup

                 where taxRuntimeLookup.RecId == taxRuntimeLookupVersion.Lookup

                       &&  taxRuntimeLookup.DocContext ==  taxRuntimeDocContext.RecId

               join taxRuntimeDocComponentMeasure

                 where taxRuntimeDocComponentMeasure.RecId == taxRuntimeLookup.LookupOwnerRecId

                  && taxRuntimeDocComponentMeasure.DocContext ==  taxRuntimeDocContext.RecId

                  && taxRuntimeDocComponentMeasure.Name =="Rate"

                  && taxRuntimeDocComponentMeasure.ParentMeasure == 0

               join taxRuntimeDocComponent

                  where taxRuntimeDocComponent.RecId == taxRuntimeDocComponentMeasure.TaxRuntimeDocComponent

                   && taxRuntimeDocComponent.Name ==_gstcomponent

                   && taxRuntimeDocComponent.DocContext ==  taxRuntimeDocContext.RecId;

           select firstonly taxRuntimeLookupCondition

                  where taxRuntimeLookupCondition.DimValue2 == _code

                     && taxRuntimeLookupCondition.LookupVersion == taxRuntimeLookupVersion.RecId

               join taxRuntimeLookupMeasureResult

                  where taxRuntimeLookupMeasureResult.LookupCondition == taxRuntimeLookupCondition.RecId

               join taxRuntimeLookupMeasureResultDetail

                  where taxRuntimeLookupMeasureResultDetail.LookupMeasureResult == taxRuntimeLookupMeasureResult.RecId;

           return taxRuntimeLookupMeasureResultDetail.Value;

       }

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
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans