Copying Image Data.

Guys i have a requirement that i want to transfer the filtered items data from one company to another company. I write the following code to transfer the data it is copying the data from company A to company B. But the problem is with the picture data. The picture field is there in items table with field type BLOB.

Now the issue is that when i transfer the data from company A to B it transfers all the data except the picture that is also in the same items table.

ITEMA.CHANGECOMPANY(‘APOSTROPHE’);
ITEMB.SETRANGE(“No.”,‘371182’);
IF ITEMB.FIND(’-’) THEN BEGIN
ITEMA.INIT;
ITEMA.COPY(ITEMB);
ITEMA.INSERT;
END;
MESSAGE(‘FINISH…’);

Thanks in advance.

Please call a ItemB.CLACFIELDS(Picture) before copying the record.

BLOBS are not automatically fetched from the database to save time when the information is not needed.

And by the way, It is not necessary to call the COPY command, the following would be sufficient:

IF ItemB.GET(‘371182’) THEN BEGIN
ItemB.CALCFIELDS(Picture);
ItemA := ItemB;
ItemA.CHANGECOMPANY(‘APOSTROPHE’);
ItemA.INSERT;
END;