Conditional Formtting

dineshkumarcserdineshkumarcser Member Posts: 34
Dear all,

Is Conditional Formatting is possible in navision forms

like if we goes to sales order list form

there we color fields according to our requirement like

if location is blue then sell to customer no is of red color otherwise green

Comments

  • MBergerMBerger Member Posts: 413
    In the OnFormat trigger of "Sell-to customer no." :
    if "Location Code" = 'BLUE' then
      Currform."Sell-to Customer No.".UpdateForeColor(255)
    else
      CurrForm."Sell-to Customer No.".UpdateForeColor(255*256) ;
    

    Btw, in this case i would make a new field in the location table to store the color you want, and retrieve that in the above code. That way you don't have to use any magic numbers/codes. The code ( stil in the OnFormat trigger ) would then become something like :
    if not Location.get("Location code") then
      Location.init ;
    
    CurrForm."Sell-to customer No.".UpdateForeColor(Location."Customer Color" ;
    
  • dineshkumarcserdineshkumarcser Member Posts: 34
    thank u so much

    can u plz tell me how to pick this color code
  • MBergerMBerger Member Posts: 413
    thank u so much

    can u plz tell me how to pick this color code
    I have made a function for it in almost all databases we have here, so i can just use the Red, Green and Blue values :
    RGB ( R : Integer, G : Integer, B : Integer ) : Integer
    
    if R < 0 then R := 0 ;
    if R > 255 then R := 255 ;
    if G < 0 then G := 0 ;
    if G > 255 then G := 255 ;
    if B < 0 then B := 0 ;
    if B > 255 then B := 255 ;
    
    Exit( R + ( G * 256 ) + ( B * 256 * 256 ) ) ;
    
  • SavatageSavatage Member Posts: 7,142
    MBerger wrote:
    I have made a function for it in almost all databases we have here, so i can just use the Red, Green and Blue values

    As Also seen here:
    viewtopic.php?f=5&t=42489

    & another:
    http://www.mibuso.com/dlinfo.asp?FileID=1055

    all your color needs will be met by these few posts :thumbsup:
Sign In or Register to comment.