CustomerCompA.CHANGECOMPANY('SOURCE COMPANY NAME'); //can be skipped if executing from source company already CustomerCompB.CHANGECOMPANY('TARGET COMPANY NAME'); IF CustomerCompA.FINDSET THEN BEGIN REPEAT CustomerCompB.COPY(CustomerCompA); IF NOT CustomerCompB.INSERT(FALSE) THEN BEGIN //could be that a customer with the same No. already exists TempCustomer.COPY(CustomerCompA); //if that happens we want to show TempCustomer.INSERT(FALSE); //a list of customers that could not be copied END; UNTIL CustomerCompA.NEXT = 0; END; PAGE.RUN(0, TempCustomer); //display the customers that could not be copiedVariables here:
CustomerCompA - Record - Customer CustomerCompB - Record - Customer TempCustomer - Record - Customer (Temporary=Yes)If you want to copy related records, then you need to copy those related records in the same way.
Answers