Hi Experts,
I am trying to hide(visible=false) menu item "buttonUpdatePackingSlip" for specific user. I created a table and assign userid there and checking userid if exists hide the menu button.
But getting error using below code.
[ExtensionOf(formStr(SalesTable))]
public final class SFA_SalesTable_Packingslip_Extension
{
public void init()
{
next init();
if (this.isUserInConfig())
{
// Find the "Generate Packing Slip" button and make it invisible
FormButtonControl packingSlipButton = this.design().controlName('buttonUpdatePackingSlip');
if (packingSlipButton)
{
packingSlipButton.visible(false);
}
}
}
private boolean isUserInConfig()
{
SFA_PackingSlip_UserId userConfig;
select firstOnly RecId from userConfig
where userConfig.UserId == curUserId();
return userConfig.RecId != 0;
}
}
Thanks,
Faiz