Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Post a sales order by different user id.

(1) ShareShare
ReportReport
Posted on by

Hello,

            Currently I'm working on 'Sales Order' page. Whenever I post a sales order it shows a menu which has three options: Ship, Invoice, Ship and Invoice.

            Now I want a particular user suppose user 'RAJ\HP' & he can only 'Ship' a sales order. He can't post an 'Invoice' & 'Ship & Invoice'

            Suppose there is another user & he only has the permission to post an 'Invoice'. He can't post 'Ship'  & 'Ship and Invoice'.

            How can I do this please help!

*This post is locked for comments

  • Verified answer
    Tharanga Chandrasekara Profile Picture
    Tharanga Chandrasekara 23,116 on at
    RE: Post a sales order by different user id.

    You do not need to customize 81 codeunit and it is not recommended to customize for every small modification as it can be achieved with the use of default version.

    In order to achieve your requirement you can create separate role set and assign related permissions. As an example if a user can only ship the invoice, what you can do is create a separate role and assign the "Sales Shipment Header" and "Sales Shipment Line" table access to the particular user and remove "Sales Invoice Header" & "Sales Invoice Line". By doing this user will not be able to post anything to "Sales Invoice Header". Which means system indirectly block the invoicing access from the user. Same way you can create a separate role for invoicing.

    *Always try for workarounds before jumping into a modification, as it allow a smooth upgrade path to you.

  • Verified answer
    Rabin Profile Picture
    Rabin 2,976 on at
    RE: Post a sales order by different user id.

    Hie Rajat,

    The way i would approach this issue is by Creating two users that you already have, one for Shipment and one for Invoice.

    Since these are two different department they should not be able to interfere the operations of different department.

    Now, if you want someone to do both the operation(if you have a single department for both ship and invoice) then you may create a user with both the Roles.

    I personally try to customize lesser and try solving the issue with the Configurations and logic.

    In general flow: Warehouse Department does Shipment and then waits for Finance department to Invoice it. NAV gives the way to handle both together but we should not get confused with it.

    Hope my answer gave some perspective on the issue.

    Thank you.

  • Suggested answer
    RockwithNav Profile Picture
    RockwithNav 6,562 on at
    RE: Post a sales order by different user id.

    Rajat,

    You need to write the code in Codeunit 81 as there you will find these separate Radio Buttons and how they are called.

    Here you can add some custom fields in user set-up table as "Shipping allowed","Both Allowed","Invoicing allowed"

    Now you should play with these Flags and write your code in Codeunit 81 where Selection is getting assigned and give the error if not permitted.

  • Suggested answer
    Ashwini Tripathi Profile Picture
    Ashwini Tripathi 4,624 on at
    RE: Post a sales order by different user id.

    You can handle by doing bit customization like on user setup check it and provide selection Menu accordingly or by setting appropriate user Roles.

    If you want to avoid unnecessary coding go for User Role Setup option safe and further configurable.

  • Suggested answer
    RE: Post a sales order by different user id.

    Better, you should create different User Roles i.e. One for Shipment and One for Invoice. Further, you can give the relevant rights to the concern users.

    It is not good practice to go for customization for each and every requirements, as Migration becomes very difficult.

    If at all needed as last option,  refer code suggested by Nareshwar, which would certainly meet your requirement.

  • Suggested answer
    RE: Post a sales order by different user id.

    Hi,

    You can handle this via the permissions sets. But since you have a flat permission structure, I would propose the customized way.

    In the user setup add three boolean fields, say, SalesShipAllow, SalesInvAllow, SalesShipInvAllow and assign the users who have permissions.

    Then write the following highlighted code in Codeunit 81, Sales-Post (Yes/No). UserSetup is a record variable of Table 91, User Setup.

    Check screenshot.

    123455.PNG

    Technically this is the solution. But you have to think about other scenarios which you do need this, especially on the other sales document posting. Double check before using this solution.

  • Amol Salvi Profile Picture
    Amol Salvi 18,694 on at
    RE: Post a sales order by different user id.

    Hi,

    Think it is bit tricky but you can look at the codeunit 81 and modify based on the user.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,575 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,493 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans