On Input change--color Change

ShonatinaShonatina Member Posts: 114
hi all,

i want to know ,is there any way we can change the color of the field value when the value is change! i tried using the updatecolorfore codes ijn the format trigger! bt it doesnt produce the result i want.

i have alrecy gone through all the old post. but none is related to what i want. so can can one please suggest another way then the Onformat !

please see the attachment to understand clearly.... thanks
smile always
shona
That which you seek inside is that which you find outside

Answers

  • ShonatinaShonatina Member Posts: 114
    sorry it seems my attachment is very big! please see this link

    http://dynamicsuser.net/forums/t/33290.aspx

    thanks:)
    smile always
    shona
    That which you seek inside is that which you find outside
  • AdrianAkersAdrianAkers Member Posts: 137
    Have you tried calling on the OnAfterValidate trigger UPDATECONTROLS?
  • ShonatinaShonatina Member Posts: 114
    thanks for the reply...

    how do i do that?
    smile always
    shona
    That which you seek inside is that which you find outside
  • AdrianAkersAdrianAkers Member Posts: 137
    On the OnAfterValidate trigger of your control (the one you are trying to change the colour for) call "CurrForm.UPDATECONTROLS"
  • ShonatinaShonatina Member Posts: 114
    Are you saying that after i write the updateforecolor codes in the format trigger, i write this updatecontrols in the after validate trigger too?

    thanks.
    smile always
    shona
    That which you seek inside is that which you find outside
  • AdrianAkersAdrianAkers Member Posts: 137
    The control where you have changed the colour on the format trigger also has an OnAfterValidate trigger. Try putting CurrForm.UPDATECONTROLS in the OnAfterValidate trigger of the above mentioned control...
  • ShonatinaShonatina Member Posts: 114
    yea did as you told me to...still the same trouble!....
    smile always
    shona
    That which you seek inside is that which you find outside
  • ZephyrZephyr Member Posts: 110
    Hey Shonatina, Use this code then check :


    OnFormat(VAR Text : Text[1024];)

    CurrForm.Name.UPDATEFORECOLOR(temp);



    OnAfterValidate()

    temp := 643;
    CurrForm.UPDATECONTROLS;

    (temp is an integer variable here)
    Zephyr
  • ShonatinaShonatina Member Posts: 114
    thanks Zephyr

    i tried as you said what happens now is! the value in my entire field is changed on a simple click on that text!
    smile always
    shona
    That which you seek inside is that which you find outside
  • ZephyrZephyr Member Posts: 110
    Sona What you exactly want to do ? I thought you want to change color of data when you will change the data of that field, may i right :?:
    Zephyr
  • ShonatinaShonatina Member Posts: 114
    yea you are right.

    i think the problem lies in not specficing the specific line. i have generally coded it like this

    IF "Conceptual Design(CD)" <> Esttemp."Conceptual Design(CD)" THEN
    CurrForm.Cd.UPDATEFORECOLOR(255);

    so can anyone tell me how to be specific in this code? ](*,)

    thanks.
    smile always
    shona
    That which you seek inside is that which you find outside
  • SogSog Member Posts: 1,023
    Isen't it better to just use xRec?
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • ShonatinaShonatina Member Posts: 114
    the problem with using xrec is that, once i move out of the field the color changes back to normal. ](*,)
    smile always
    shona
    That which you seek inside is that which you find outside
  • SogSog Member Posts: 1,023
    so on the aftergetcurrrecord you have something like
    esttemp.copy(xrec);
    and then compare any changes to that record.

    You could check on the value itself, so that a simple click wouldn't change it
    Make sure the esttemp isen't assigned again on an edit.
    Perhaps you could check on primary key, if that has changed set it as esttemp.

    The only thing then you have to catch is the onrename.
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • ShonatinaShonatina Member Posts: 114
    Sog wrote:
    so on the aftergetcurrrecord you have something like
    esttemp.copy(xrec);
    and then compare any changes to that record.

    You could check on the value itself, so that a simple click wouldn't change it
    Make sure the esttemp isen't assigned again on an edit.
    Perhaps you could check on primary key, if that has changed set it as esttemp.

    The only thing then you have to catch is the onrename.

    'm writing my codes in the Onformat trigger! And i did as you said, tried to write the code you asked me to! esttemp.copy(xrec);

    but when i wrote this code its giving me error msg. :-k And i have already wriiten CurrForm.UPDATECONTROLS;

    thanks :)
    smile always
    shona
    That which you seek inside is that which you find outside
  • SavatageSavatage Member Posts: 7,142
    Shonatina wrote:
    yea you are right.
    i think the problem lies in not specficing the specific line. i have generally coded it like this
    IF "Conceptual Design(CD)" <> Esttemp."Conceptual Design(CD)" THEN
    CurrForm.Cd.UPDATEFORECOLOR(255);
    so can anyone tell me how to be specific in this code? ](*,)
    thanks.

    I tried this on the sales line as a test .. It changes color of the unit cost field if the unit cost field on the sales line doesn't match what's on the item card. It works, is this what you're trying to do?
    OnFormat(VAR Text : Text[1024];)
    IF Item.GET("No.") THEN BEGIN
      IF "Unit Cost ($)" <> Item."Unit Cost"
        THEN CurrForm."Unit Cost ($)".UPDATEFORECOLOR(255)
        ELSE CurrForm."Unit Cost ($)".UPDATEFORECOLOR(0);
    END;
    

    On your code you never set it back to black if it's actually correct - hence the whole column turning.
  • ShonatinaShonatina Member Posts: 114
    Thanks harry =D> :D
    Thank you All :D

    it worked \:D/ :D
    smile always
    shona
    That which you seek inside is that which you find outside
Sign In or Register to comment.