Change form background color in dynamics Ax

Problem : I was assigned by a task to change the background color of a form by company 
               so user can differentiate between companies.

Solution : 
                
                 Class Name : SysSetupFormRun

              Overrides the run method with following code

              public void run()
              {
                            ;
                            super();
                            switch(curext)
                            {
                                    case "AYN":
                                                       this.design().colorScheme(FormColorScheme::RGB);
                                                       this.design().backgroundColor(WinAPI::RGB2int( 204,255,0));  
                                                       break;
                                   case "CAT":
                                                       this.design().colorScheme(FormColorScheme::RGB);
                                                       this.design().backgroundColor(WinAPI::RGB2int (155,255,0));
                                                       break;
                             }
                 }
                 it solved my problem

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.