Hi,i’m novice of navision,i want to automaticlly change the color(red) of sales line while it fulfil some condition,for example,if “quantity shipped”<>“quantity”,then “document no.” will be change to red.i have added below code on onformat of document no:
IF salesline.“Quantity Shipped”<>salesline.Quantity THEN CurrForm.“Document No.”.UPDATEFORECOLOR:=red;
Where did you put your code? To change color to a field in a specific line you should use the field OnFormat trigger… and, of course, set the ELSE condition, as Munib already said.
Hi,munib: Thank for your answer,but I add ELSE statement, all lines still changed red(contain quantity received=quantity of lines),that is not what I hope.
Hi,Anna: My code put in Onformat trigger of **Document No.**field,whole code below:IF salesline.“Quantity Shipped”<>salesline.Quantity THENCurrForm.“Document No.”.UPDATEFORECOLOR:=255****ELSE **CurrForm.“Document No.”.UPDATEFORECOLOR:=32768;**Byt result is still not what I want,all line changed red.Then,where is my mistake?Best regards Billwan