Tuesday, June 5, 2012

Copying docuemnt attachment record from one table to another table

In Microsoft Dynamics 2012, recently, I had a requirement to attach a document that is attached to Purchase order table to another table.

There is a method copy available in DocuCopy class that does the job for us.

For that purpose I used the following code that copies the record attached to one table to other table.

MyTable table = table::find(...);
PurchTable purchTable = PurchTable::find(...);

Docu::copy(purchTable, table)

Copy method accepts two arguments Common _fromTable, Common _toTable