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’);
};
});
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
Hi Chris.
I’m new to scripts.
I did one that fulfilled some information based on the subsidiary on the inventory adjustment form.
Can you help me to make it work?
Thank you.
Maldonado