NAV 2015 - Copy a specific field of RecordRef

Dear all,

I  had a function to copy data from 1 recordref to another.

I'm trying to copy a specific field but it's not ok.

Here's my code, it does not show error but it copy all the other fields (with the default value!). Please share your ideas about this?

 

FOR i := 1 TO FromTableRef.FIELDCOUNT DO BEGIN

FromFieldRef := FromTableRef.FIELDINDEX(i);

IF FromFieldRef.NUMBER = 'specific Field ID here' then

BEGIN

ToFieldRef := ToTableRef.FIELDINDEX(i);

ToFieldRef.VALUE := FromFieldRef.VALUE;

END;

END;

 

Thanks and best regards,

Related
Recommended