Hi,
I'm Trying to synchronize tables from a company to another one.
the issue is that when the user change a field from a primary key.
exp:
in the company N°1
cust No: CUST0001
cust name : company xxxxx
address : xxxxx
if the user change the cust No: from Cust0001 to Cust01 after the synchrozation in company N°2
the function deleate the cust No: Cust0001
than nav creat the customer Cust01 with
cust name : ''
address : ''
so I loose all the data that are in the other fields :shock:
The function code is:
KeyRef := RecRef.KEYINDEX(1);
FOR KeyFieldCount := 1 TO KeyRef.FIELDCOUNT DO BEGIN
FieldRef := KeyRef.FIELDINDEX(KeyFieldCount);
ValidationFieldID := FieldRef.NUMBER;
IF KeyFieldCount = 1 THEN
ValidateFieldValue(RecRef,FieldRef,Value1);
END;
RecRef.RENAME(NewValue1);
Comments
You probably have to do a RecRef.FIND('=') before the RecRef.RENAME.
Object Manager