Today I'll describe how to find out whether the user has a specific role or not by coding. I am required to enable or disable one field on the form based on a specific user role.
public void init()
{
next init();
if (xUserInfo::checkUserRole('Manager'))
{
BypassFormulaLineSpecification.enabled(true);
}
else
{
BypassFormulaLineSpecification.enabled(false);
}
}
Here, I'm looking for 'Manager' role, and if the user has that role, then the BypassFormulaLineSpecification field will be enabled.
public void init()
{
next init();
if (xUserInfo::checkUserRole('Manager'))
{
BypassFormulaLineSpecification.enabled(true);
}
else
{
BypassFormulaLineSpecification.enabled(false);
}
}
Here, I'm looking for 'Manager' role, and if the user has that role, then the BypassFormulaLineSpecification field will be enabled.
*This post is locked for comments