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

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;

Did you try

FADeprBook.RESET;
FADeprBook.SETCURRENTKEY(“FA No.”);
FADeprBook.SETRANGE(“FA No.”,“No.”);
FADeprBook.MODIFYALL(“FA Block Code”,“FA Block Code”);

Using debugger I found the problem is that after FADeprBook.SETRANGE(“FA No.”,“No.”); there is no record found. I tried using FADerpBook.GET(“No.”,COMPANY); still it says no such record exist