RE: Create a User Event Script to revoke access to Reallocate item page

I’m trying to create a user event Script to deny access to the page Reallocate Items.

I cannot revoke this access or change the permission on the Role, because my Sales Team needs to Edit Sales Orders and this permission uses the same permission.

I’m trying to use this, but it is not working.

function userEventBeforeLoadRealloc(){
if(nlapiGetRole()!=3)
//or (nlapiGetRole()!=1040)// 3 is the internal ID of the administrator role. Specify which roles will be allowed access to the page
throw nlapiCreateError(‘ERROR’, You are not allowed to access this page’);
};
});

maldonado Rookie Asked on November 2, 2022 in Inventory.
Add Comment
2 Answers

Hi,

Could you try logging nlapiGetRole() to see if the script is running at all.

Also, what users/roles is the script set to run for?

Thanks,

Chris

Intermediate Answered on November 17, 2022.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.