1. Navigate to Page 357.
2. Open in Design Mode.
3. Open Page Properties.
4. Make DeleteAllowed - NO.
This will remove the Delete Action from the Company page and no one can delete the company.
If you want to make it User Wise then follow this this Process
Method 2.
1.Open Table 2000000006
2.Write code on OnDelete Trigger.
3. UserSetup.GET(USERID);
IF NOT (UserSetup."Company Deletion Allowed") THEN
ERROR('User dont have the Permission to delete the Company');
Make a New Field in User Setup Table as "Company Deletion Allowed" . This way it will become Dynamic and you can handle this from the User Setup.
4. If you want to make it completely hard coded as only 1 user can delete like the administrator only then write this code
UserSetup.GET(USERID) ;
IF NOT (USerSetup."USER ID" = 'ADMINISTRATOR') THEN
ERROR('User dont have the Permission to delete the Company');
What do you mean by Nav Group. If you will assign SUPER role to each user then its a master permission that you will give them and they can do anything with complete right.
If you just want to avoid deletion of the companies then you cant do the way you are expecting instead you have to make a new Roles the same as of super and you need to remove that system role and then assign specifically to each Individual user.
P.S - How users will delete the company - If from the Companies page then why not simply you remove the Delete Allowed permission from that particular page.
1. Navigate to Page 357.
2. Open in Design Mode.
3. Open Page Properties.
4. Make DeleteAllowed - NO.
This will remove the Delete Action from the Company page and no one can delete the company.
If you want to make it User Wise then follow this this Process
Method 2.
1.Open Table 2000000006
2.Write code on OnDelete Trigger.
3. UserSetup.GET(USERID);
IF NOT (UserSetup."Company Deletion Allowed") THEN
ERROR('User dont have the Permission to delete the Company');
Make a New Field in User Setup Table as "Company Deletion Allowed" . This way it will become Dynamic and you can handle this from the User Setup.
4. If you want to make it completely hard coded as only 1 user can delete like the administrator only then write this code
UserSetup.GET(USERID) ;
IF NOT (USerSetup."USER ID" = 'ADMINISTRATOR') THEN
ERROR('User dont have the Permission to delete the Company');
Answers
What do you mean by Nav Group. If you will assign SUPER role to each user then its a master permission that you will give them and they can do anything with complete right.
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/
If you want to restrict users accessing multiple companies then you can look into this thread once
forum.mibuso.com/discussion/46305/restricting-a-super-user-to-access-only-one-company
If you just want to avoid deletion of the companies then you cant do the way you are expecting instead you have to make a new Roles the same as of super and you need to remove that system role and then assign specifically to each Individual user.
P.S - How users will delete the company - If from the Companies page then why not simply you remove the Delete Allowed permission from that particular page.
Many thanks
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/
Method 1.
1. Navigate to Page 357.
2. Open in Design Mode.
3. Open Page Properties.
4. Make DeleteAllowed - NO.
This will remove the Delete Action from the Company page and no one can delete the company.
If you want to make it User Wise then follow this this Process
Method 2.
1.Open Table 2000000006
2.Write code on OnDelete Trigger.
3. UserSetup.GET(USERID);
IF NOT (UserSetup."Company Deletion Allowed") THEN
ERROR('User dont have the Permission to delete the Company');
Make a New Field in User Setup Table as "Company Deletion Allowed" . This way it will become Dynamic and you can handle this from the User Setup.
4. If you want to make it completely hard coded as only 1 user can delete like the administrator only then write this code
UserSetup.GET(USERID) ;
IF NOT (USerSetup."USER ID" = 'ADMINISTRATOR') THEN
ERROR('User dont have the Permission to delete the Company');
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/