On input change--color change

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[:)]5482.value.bmp (2.25 MB)

Hi Shona,

Using the UPDATEFORECOLOR on the ONFORMAT trigger will change the colour of a field but this will depend on when you are calling this. Can you post your code.

sure…see i have different code…wil post all

IF “Conceptual Design(CD)” = xRec.“Conceptual Design(CD)” THEN BEGIN
CurrForm.Cd.UPDATEFORECOLOR(0);
END ELSE BEGIN
RANDOMIZE;
CurrForm.Cd.UPDATEFORECOLOR(RANDOM(999999999));
CurrForm.Cd.UPDATEFONTBOLD(TRUE)
END;

(or)

IF (xRec.“Conceptual Design(CD)” = Esttemp.“Conceptual Design(CD)”) AND (“Conceptual Design(CD)” <>
Esttemp.“Conceptual Design(CD)”) THEN BEGIN
RANDOMIZE;
CurrForm.Cd.UPDATEFORECOLOR(RANDOM(999999999));
CurrForm.Cd.UPDATEFONTBOLD(TRUE)
END ELSE BEGIN
CurrForm.Cd.UPDATEFORECOLOR(0);
END;

what i want it, in this snap i have attached, all the values for the fields are taken from another table which has the std value when we select an option in the com[plexity! so when the user change the std value, the color has to change.

Hi,

Using XRec will on be in effect once you are on the record is question - if you navigate off and back XRec is reset

Why are you using the RANDOM function - look up the help on RBG colours

Otherwise it should work

e.g.

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

no it doesnt wrk! i want it to change only when i change the value! And that too only that value in that particular field should change not all the values in the field!

Random coz ma clients want differnt color everytime they change:)

what your code does is, change the entire field as i have shown in my attacted snap to red! i want the color to change only red when i change the value! othewise it should be only black!

Hi Shona,

You would need to populate the Esttemp variable each time possible in the OnAfterGetCurrentRecord variable. The code will then change the field to red once different for the Esttemp record.

i was writting the code in onformat! the updateforecolor doesnt wrk in any other triger na!

what exactly do you mean by your last post? can you be bit more specific? and what type of codes should i use?

thanks

And the Esttemp is my base table from which the std values are picked up based on the option selected in the form i have shown here.

please can any1 help! its urgent!

Hi Shona,

First of all, please do not mark posts as urgent - if it’s urgent then contact Microsoft for paid support. Also I would question how urgent this is as you had time to post three times in break space forum [:O]

I assumed that Esttemp was a temporary copy of the records. You need to think through the example given to solve this - not all the code needs to go into the same trigger.

hi dave…

since i had time with me and is a lot stressed out with not getting the result i wanted…My only option to relax were to post n read jokes to relax myself! thats the advised stress relief mechnism!

And no esttemp is not a tempory table…its Estimate template table which has my base std values…

mmmm i would love to take help from my seniors or Nav collegue working here with me…but unforutunately the only Nav technical consultant in the office permises is me! all others are on-site with releasing our finished products. so i have to deal with all queries and problems we face here.

thanks…

Hi Shona,

I know you are doing the best you can but you shouldn’t be left in this position.

Your problem is: If you use XRec - this will work only while the user is on the record and will disappear once you return to the record. So you will need to keep a copy of the data before input and compare this to the input.

mmmm that what this EstTemp act like! its my copy! see this code.

IF “Conceptual Design(CD)” <> Esttemp.“Conceptual Design(CD)” THEN BEGIN
RANDOMIZE;
CurrForm.“Conceptual Design(CD)”.UPDATEFORECOLOR(RANDOM(999999999));
CurrForm.“Conceptual Design(CD)”.UPDATEFONTBOLD(TRUE)
END ELSE BEGIN
CurrForm.“Conceptual Design(CD)”.UPDATEFORECOLOR(0);
END;

still the same error occurs! its regardless of my changing the field value, the color is changed!!

Hi Shona,

Two issues:

  1. How do you populate the value into EstTemp

  2. If you point EstTemp at the live file then it will be updated the the form commits the record. Make the a temporary file and fill when opening the form

oh! its actually like this.i use an option field for complexity.

i use 2 tables , current tables to show the value depending upon the complexity selected. and this current table gets the value from my 2nd table estimation template. so the values in the esttemp are alredy given!

now are you suggesting that i create one more table? then how do you supppose i do? cause my current table picks value from Esttemp, & when this picked value is changed, i need the color to change to indicate that this value is changed and not the std value!..

Thanks,

What do you do to make sure that the values you are comparing are from the same line? I see nothing to get the right line in Esttemp.

In all honesty, I think not. Sorry to be honest, and if you don’t want honesty, pleae let me know and next time I will either just lie or not reply.

The issue here is that really you don;t have any idea what the customer wants, you don’t know why they want it and you don’t really even know if they really need it or they just think they need it. Random colors sounds like a game thing, not something for an ERP system. You say you don’t have any seniors in your company that can help. So what are you expecting, you can not think that a customer that pays you will get support form the community and you take the money.

Firstly this is not a technical issue, it is a business need, driving programming simply because no one knows what to do. In this industry, its often easier to bill a client 40 hours for programming than it is to bill them 4 hours of training and business consulting. If your company does not have business analysts then it should not be in this industry.

if you are adamant on writing some code to “fix” this, then call Microsoft, log a call and pay them to help you.

anna if you see, “Conceptual Design(CD)” <> Esttemp.“Conceptual Design(CD)” ! the first “Conceptual Design(CD)” refers to the rec’s field line and Esttemp.“Conceptual Design(CD)” refers to the conceptual design of my table estimation template.

so i have compared my rec’s value and this exist tables value! if they are same then no change.

if they are different then change!

You didn’t answer my question.

I guess, but is just a guess - I might be wrong - that EstTemp is a temporary table which you load in the OnOpenForm trigger copying the real table content.

Both tables, the real one and the temporary one might contain many lines (or records, as you like to call them).

Now, when you write IF “Conceptual Design(CD)” <> Esttemp.“Conceptual Design(CD)” THEN BEGIN you compare the value of "Conceptual Design(CD)"in the current line of the real table with the value of “Conceptual Design(CD)” in which line of EstTemp?