Wednesday, January 28, 2026

Customization for Company ID in Assign Organization Form D365 in X++.

 Business Requirement Overview:

The organisation requires the Company ID to be visible along with the Company Name in the Assign Organisation form.
This enhancement will help users easily identify companies, especially when multiple companies have similar or identical names.

 

Scenario: Customise the company name with the company id

Customise the Assign Organisation form to display the Company ID along with the Company Name.

System administration>User>Assign Organisation

 

Current Behaviour:

·       The Assign Organisation form displays only the Company Name.

·       The Company ID is not visible to the user.

Required Behaviour:

·       The Company ID should be displayed along with the Company Name in the Assign Organisation form.

·       The display format should clearly identify both values.


Code:-

[ExtensionOf(FormStr(SysSecRoleAssignOM))]
internal final class SysSecRoleAssignOM_Extension
{
    public void fillTree()
    {
        next fillTree();
        CompanyInfo ci;
        OMHierarchyRelationship relationship;
        OMInternalOrganization  organization;
        boolean hasChildren;

        organizationTree.deleteAll();

        if (!hierarchyId)
        {
            while select Name, Dataarea,RecId from ci
            {
                SysFormTreeControl::addTreeItem(
                    organizationTree,
                    ci.Name + "- ("+ci.dataarea +")",
                    FormTreeAdd::Root,
                    ci.RecId,
                    this.getImage(ci.RecId),
                    false);
            }
        }
    }

}







No comments:

Post a Comment

How to run Runnable class in Sandbox enviornment.

I created a runnable class, and it is working fine in the development environment. After that, I moved the class to the Tier-2 environment. ...