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

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Structure for Sales and Purchases

(0) ShareShare
ReportReport
Posted on by

Hello.....

I have only one structure (sales tax structure) in the database.

But still I need to select the structure from the drop down list.

How can I bring the structure automatically in the purchase and sales documents?

-- Harsha

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Mohana Yadav Profile Picture
    60,977 Super User 2025 Season 2 on at
    RE: Structure for Sales and Purchases

    Not possible in standard Navision

    but you can write code in OnInsert trigger of tables 36 and 38.

  • Verified answer
    Community Member Profile Picture
    on at
    RE: Structure for Sales and Purchases

    Hi Harsh,

    You can customize it by writing code in OnInsert trigger.

  • Verified answer
    Saurabh Shah Profile Picture
    4,560 on at
    RE: Structure for Sales and Purchases

    Hi Harsh,

    Another option is to set the structure code on customer and vendor card. There is a field available in both the table so if you set the structure code on it then in sales order and purchase order respectively. it will auto populate on selection of customer or vendor code.

    This will work for your requirement.

    Regards,

    Saurabh Shah

  • Verified answer
    Snehanshu Mandal Profile Picture
    560 on at
    RE: Structure for Sales and Purchases

    This need a bit of coding :). In 2 areas you write your codes -

    a. Sales header:

    - in INITRECORD() function, go to the end of all codes and  put the following 1 line

    Structure := '<your structure>';   (put your structure name in single quotes). Say your structure name is 'STRUC01' so last 3 lines of INITRECORD() function will look like as below:


    "Responsibility Center" := UserSetupMgt.GetRespCenter(0,"Responsibility Center");
    "Time of Removal" := TIME;

    Structure := 'STRUC01';

    Compile it , re-login and try. This will work whenever you are creating a new sales document (Invoice, order, credit memo) but will not work while you are modifying an existing document.

    Do remember, this is a bit hard-coded and it will always pick up the same structure code (even if you have more structure codes in your setup in future). But you have the option of changing the structure once the default structure is selected.

    b. The same coding you can follow for the purchase header too in the INITRECORD function.

    Try this out. Best of luck.

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
Alexander Ermakov Profile Picture

Alexander Ermakov 2

#2
SC666 Profile Picture

SC666 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans