Thursday, October 27, 2011

Change form background color in dynamics Ax

How to change form background color overall in 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