acumatica - Attachments Overrides existing while adding from VendorMaint graph -


i importing data , documents third party application acumatica.

after importing, creating vendor dynamically using below code along attachments.

vendormaint graph = pxgraph.createinstance<vendormaint>(); vendorr row1 = null; row1 = new vendorr(); row1.acctname = vendorname; row1.noteid = noteid;      // existing - guid created while importing graph.baccount.update(row1); 

if attachment exists should update instead of duplicating.

in case if vendor exists files attached, code overrides these attachments , remove previous files attached existing vendor.

i want add attachment instead of override existing attachment. suggestion?

try use insert method of view:

vendormaint graph = pxgraph.createinstance<vendormaint>(); var row1 = new vendorr(); row1 = graph.baccount.insert(row1); if (row1 == null) // inserted or wasn't able insert {       //some logic newly created vendor } else {       //some logic existed } row1.acctname = "vendor name"; row1.noteid = noteid;      // existing - guid created while importing graph.baccount.update(row1); 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -