06 October 2010

How to colour code different companies inside axapta

During development and test we often switch between different companies in our installation. To not mistaken us, so we always make changes in the correct one, we made this small change in the code. With different background-colours for each company, you never delete something importent by mistake. This example shows how it could be done.

Again we use the SysSetupFormRun class, but this time we look into the Run method. Add below code between the start/end comments and restart your client. Next time you start, all forms will have the background colours you set for each specific company.

// --- START 071001 Fourone/JOJ (EnvironmentAddOns4)
// --- Description: Display company 'xxx' with different
// background color
public void run()
{
FormDesign formDesign = this.design();

super();
if (companyinfo::find().dataAreaId=="dmo")
{
if (formdesign)
{
formDesign.colorScheme(2);
formDesign.backgroundColor(0x00ff);
formdesign.caption("-- dmo -- ");
}
}
// --- END 071001 Fourone/JOJ (EnvironmentAddOns4)
}

No comments:

Post a Comment

Give me the commetns and solutions

How to add the Display method in the form level in D365 F&O

 The below examle is to add the form -Data source level adding display method and assigning to form design control.