May 22, 2012

Merging Two records

Merging Two records

//we will explore how to correct such a situation by merging two records including
//all their related transactions. For the demonstration, we will merge two vendor accounts 5001
//and 5002 into a single one, that is, 5001.

static void VendAccountMerge(Args _args)
VendTable vendTable;
VendTable vendTableDelete;
PurchJournalAutoSummary jourSummary;

delete_from jourSummary
where jourSummary.VendAccount == #vendDelete;
select firstonly forupdate vendTableDelete
where vendTableDelete.AccountNum == #vendDelete;
select firstonly forupdate vendTable
where vendTable.AccountNum == #vend;

No comments:

Post a Comment


Note: Only a member of this blog may post a comment.