Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV forum
Answered

Structure for Sales and Purchases

Posted on by Microsoft Employee

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

Categories:
  • Verified answer
    Snehanshu Mandal Profile Picture
    Snehanshu Mandal 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.

  • Verified answer
    Saurabh Shah Profile Picture
    Saurabh Shah 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
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Structure for Sales and Purchases

    Hi Harsh,

    You can customize it by writing code in OnInsert trigger.

  • Verified answer
    Mohana Yadav Profile Picture
    Mohana Yadav 58,878 Super User 2024 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.

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,558 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,647 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans