How Do You Change the Color of a Record in NAV

jmcitjmcit Member Posts: 10
Hello,

I need to highlight in red a record in NAV given a condition is met.

When trying to do this on a form it reports ...

The Dynamic Property 'ColorSet' cannot be changed in this context. Please could you advise.

Thank You

A

Comments

  • geordiegeordie Member Posts: 655
    You need to handle the condition in the OnFormat trigger and use the property UPDATEFONTCOLOR:
    OnFormat(VAR Text : Text[1024];)
    IF .. THEN
      CurrForm.Status.UPDATEFORECOLOR(255)
    ELSE 
      CurrForm.Status.UPDATEFORECOLOR(0);
    END;
    
  • jmcitjmcit Member Posts: 10
    Thanks for your reply.

    How do I do this for an entire record rather than just a field on a form ??.

    Regards

    A
  • geordiegeordie Member Posts: 655
    Must be done on every single field as far as I remember.

    Daniele
  • apertierraapertierra Member Posts: 61
    geordie wrote:
    Must be done on every single field as far as I remember.

    Daniele
    Yep... you should set the color on each of the controls you want changed one by one.
  • jmcitjmcit Member Posts: 10
    STILL GETTING THE FOLLOWING ERROR MESSAGE WHEN USING THE format PROPERTY .

    The dynamic Property Colorset cannot be changed in the context.

    You tried to change the ColorSet to on the TextBox named Service Item No.

    Please help

    Regards

    Andrew
  • jmcitjmcit Member Posts: 10
    STILL GETTING THE FOLLOWING ERROR MESSAGE WHEN USING THE format PROPERTY .

    The dynamic Property Colorset cannot be changed in the context.

    You tried to change the ColorSet to on the TextBox named Service Item No.

    Please help

    Regards

    Andrew
  • apertierraapertierra Member Posts: 61
    The property you modify through the code is Forecolor using the function UPDATEFORECOLOR. (See the example that geordie posted before).
  • jmcitjmcit Member Posts: 10
    Many Thanks for all your contributions I now have this working as expected. Just a pity that there is not a single command to highlight an entire record rather than having to set the property on each field. ](*,)
  • apertierraapertierra Member Posts: 61
    rspmca wrote:
    I think you are missing a small detail: this is related to the classic client, not the RTC client....
Sign In or Register to comment.