Hi There,
Today, I'll explain how to disable a field if the user does not have an admin role. I added a new field on VendTable and then added that field to the VendTable form. Now, my requirement is to make this field editable only for users with an admin role.
I created a new class to extend the VendTable form. In the init() method, I added the logic for a new field. We can also enable or disable any field in this way.
/// <summary>
/// Extension class of VendTable table.
/// </summary>
[ExtensionOf(formStr(VendTable))]
final class VendTable_Form_Extension
{
/// <summary>
/// Coc of init()
/// </summary>
void init()
{
next init();
vendTable_ds.object(fieldNum(VendTable,
NewField)).allowEdit(Global::isSystemAdministrator());
}
}

Like
Report
*This post is locked for comments