How to disable the Posting function for the user2 but its availsble for user1

I have two users user1 ,user2

now i dont want the posting function in salesorder form for the user2 when user2 is logged on

but when user1 is login he can do it that posting function

Either you can create a new form without Post option and assign that form to user2

or

create a new boolean(Allow SO Post) field in user setup and check after clicking the Post in Form

yes i have added a boolen variable to the user set up record and set s it value to False. but its not working means thbe posting function working .is cide necessary for it

did you check that field is true or not before posting?

What if you later in time get a "user32 into your system…?

As we have added a boolean in user setup,If the administrator wants to give Post permissions to him, he will set the beelean to TRUE or FLASE…

thank you mohana , but i’m not got the point

In Form 42 - Postings Menu button - P&ost Action - Write

If NOT usersetup.“SO Post” then

ERROR(‘You do not have permissions to post the Sales Order’);

In which Trigger have to place this code

In which Trigger have to place this code

begining of On push

thank you , but the code not working end i think first we have to know whether which user is loggeg on and then we have to disable the post function

you got what you have to do…

its a simple code to get the user…

carryon…

What about handling this with Roles and Permissions?

Yeah…we can do it by roles & permissions also…

i thought this way is simple rather than creating a new role and giving permissions

Roles and permissions is the correct way to go. This way just leads to unnecessary modification to the database.

If you’re going to do it that way then you need to retrieve the user setup record from the database before checking its value.

Creating a role and adding the permissions is not a modification to database?

how much time it takes to add permissions and retrive the user setup record?

No, there is no code changed whatsoever. During an upgrade you won’t have to merge the custom code with the code in the new version. Adding a new role is simply adding data to the system.

User setup may be faster, especially if you have never gone through the effort to setup correct permissions for all of your users, but I think it’s just a quick and dirty way to do it. You start having some permissions in one place, other permissions in another place, and it can get messy. Then you start modifying objects to use your custom fields. You have to make sure that you found every place that needs the check done. NAV already has a system in place that does that for you.

Yes, you are right…that is the reason I gave this option.

now, if you give permissions option, the next question will be what perissions and where and how(not from me)?

Unless they are very detailed permissions, I take the transactional tables and set the permissions on them by role. Everything else gets lumped into ALL. So if I don’t want someone posting sales invoices, I don’t allow insert into the Customer Ledger Entry table. If I don’t want someone posting anything, I don’t allow insert into G/L Entry.

It’s only when you want very fine control over permissions that they become a burden.