Form personalisation X++ change.

Small code will help you to understand if non admin user can see Administration information in form information screen.

First you need to find form which is controlling is information.

You need to create one dummy role so you can control based on that role.

Create extension class for FormControlPersonalization form and create COC for loadControlsState method.

Following small code will help you show control and data source information to admin user.

    
[ExtensionOf(formStr(FormControlPersonalization))]
Final class FormControlPersonalization_Extension
{
public void loadControlsState()
{
SecurityUserRole securityUserRole;
SecurityRole securityRole;
UserId curUser = curUserId();
if(isSysAdmin == false)
    {
        select firstonly RecId  from securityUserRole
            exists join securityRole
        where securityRole.RecID == securityUserRole.SecurityRole
            && securityUserRole.User == curUser
            && securityRole.AotName =='FormControlPersonalizationRole';

        if(securityUserRole.recId)
        {
            isSysAdmin = true;
        }
    }
    next loadControlsState();
}
}

Leave a comment

Design a site like this with WordPress.com
Get started