Hi
can any body help me out in finding the paticular modified field in table.(i.e if i modify UOM then changed field (i.e unit of measure )is reflect on modify trigger.)
there are 2 ways : you can check Currfieldno, this has the number of the field the USER changed. it is NOT filled when changing something via code. teh other way is comparing every field in Rec with the same in xRec in the OnModify trigger
How it will work..?
i have just put message('%1',CurrFieldNo) on modify trigger of item table and at run time i am modifying to description then system returns 0 why? ](*,)
How it will work..?
i have just put message('%1',CurrFieldNo) on modify trigger of item table and at run time i am modifying to description then system returns 0 why? ](*,)
Like i stated, CurrfieldNo only has the value of the (originally) changed field when it is done by a user via a form. look it up in the helpfile !
there are 2 ways : you can check Currfieldno, this has the number of the field the USER changed. it is NOT filled when changing something via code. teh other way is comparing every field in Rec with the same in xRec in the OnModify trigger
I have also this question, but avoid to handle the page itself. There could be several other Page objects to the same Table object, but to handle every page individually is not the way I think.
To have a general solution, which field was changed, check COD423 "Change Log Management"
It's seems doing a simple iteration to check which field's value is changed (Rec vs xRec):
[External] LogModification(VAR RecRef : RecordRef)
IF RecRef.ISTEMPORARY THEN
EXIT;
IF NOT IsLogActive(RecRef.NUMBER,0,1) THEN
EXIT;
xRecRef.OPEN(RecRef.NUMBER);
xRecRef."SECURITYFILTERING" := SECURITYFILTER::Filtered;
IF xRecRef.READPERMISSION THEN BEGIN
IsReadable := TRUE;
IF NOT xRecRef.GET(RecRef.RECORDID) THEN
EXIT;
END;
FOR i := 1 TO RecRef.FIELDCOUNT DO BEGIN
FldRef := RecRef.FIELDINDEX(i);
xFldRef := xRecRef.FIELDINDEX(i);
IF IsNormalField(FldRef) THEN
IF FORMAT(FldRef.VALUE) <> FORMAT(xFldRef.VALUE) THEN
IF IsLogActive(RecRef.NUMBER,FldRef.NUMBER,1) THEN
InsertLogEntry(FldRef,xFldRef,RecRef,1,IsReadable);
END;
Answers
i have just put message('%1',CurrFieldNo) on modify trigger of item table and at run time i am modifying to description then system returns 0 why? ](*,)
I have also this question, but avoid to handle the page itself. There could be several other Page objects to the same Table object, but to handle every page individually is not the way I think.
To have a general solution, which field was changed, check COD423 "Change Log Management"
It's seems doing a simple iteration to check which field's value is changed (Rec vs xRec):