How to update FA DEPR BOOK from ONVALIDATE of FIXED ASSET's

lavanyaballurgilavanyaballurgi Member Posts: 235
Hello guys,

I am trying to update "FA BLOCK CODE" of "FA DEPR BOOK" by putting coding in FIXED ASSET table's "FA BLOCK CODE" field's ONVALIDATE trigger.

When I try to put filter on temp variable "FADeprBook" like this FADeprBook.SETRANGE("FA No.","No.");
Then FINDFIRST doesnt find the record. what may be wrong? Here is my entire coding


IF (xRec."FA Block Code" <> Rec."FA Block Code") THEN BEGIN
CLEAR(lrc_fadeprbook);
lrc_fadeprbook.SETCURRENTKEY("FA No.");
lrc_fadeprbook.SETRANGE("FA No.","No.");
IF lrc_fadeprbook.FINDFIRST THEN REPEAT
lrc_fadeprbook.VALIDATE("FA Block Code",Rec."FA Block Code");
lrc_fadeprbook.MODIFY(FALSE);
UNTIL lrc_fadeprbook.NEXT = 0;
END;

Comments

Sign In or Register to comment.