Enter Serial No In Shipment Document (SO302000) In Acumatica Using API -
can me following code trying enter shipment mix of serial , non-serial items. error receiving says "px.data.pxexception: error #246: failed commit splits row." have serial allocation can't point out issue coming from.
so302000content so302000 = oscreen.so302000getschema(); oscreen.so302000clear(); so302000.actions.addso.commit = true; so302000.addsalesorder.selected.linkedcommand = null; so302000.documentdetails.inventoryid.linkedcommand = null; list<command> ocmds = new list<command>(); //create header. ocmds.add(so302000.actions.insert); ocmds.add(new value { value = scardcode, linkedcommand = so302000.shipmentsummary.customer, commit = true }); ocmds.add(new value { value = scardlocation, linkedcommand = so302000.shipmentsummary.location }); ocmds.add(new value { value = swhscode, linkedcommand = so302000.shipmentsummary.warehouseid }); ocmds.add(so302000.actions.save); //create lines. foreach (datarow dr in ds.tables[0].rows) { dpackqty = convert.todouble(dr["qtypacked"]); if (ssonbr == dr["sonbr"].tostring() && sitemcode == dr["itemcode"].tostring()) { dcount = dcount + 1; } else { ssonbr = dr["sonbr"].tostring(); sitemcode = dr["itemcode"].tostring().trim(); dcount = 0; //ocmds.add(new value { value = "ok", linkedcommand = so302000.addsalesorderoperation.servicecommands.dialoganswer, commit = true }); ocmds.add(new value { value = "so", linkedcommand = so302000.addsalesorderoperation.ordertype }); ocmds.add(new value { value = ssonbr, linkedcommand = so302000.addsalesorderoperation.ordernbr }); ocmds.add(new value { value = "ok", linkedcommand = so302000.addsalesorder.servicecommands.dialoganswer, commit = true }); ocmds.add(new key { value = sitemcode, fieldname = so302000.addsalesorder.inventoryid.fieldname, objectname = so302000.addsalesorder.inventoryid.objectname }); ocmds.add(new value { value = "true", linkedcommand = so302000.addsalesorder.selected, commit = true }); ocmds.add(so302000.actions.addso); ocmds.add(new key { value = "='" + ssonbr + "'", fieldname = so302000.documentdetails.ordernbr.fieldname, objectname = so302000.documentdetails.ordernbr.objectname }); ocmds.add(new key { value = "='" + sitemcode + "'", fieldname = so302000.documentdetails.inventoryid.fieldname, objectname = so302000.documentdetails.inventoryid.objectname }); ocmds.add(new value { value = "0", linkedcommand = so302000.documentdetails.shippedqty, commit = true }); } if (dr["isserial"].tostring() == "y") { ocmds.add(new value { value = "ok", linkedcommand = so302000.allocations.servicecommands.dialoganswer, commit = true }); ocmds.add(new value { value = dcount.tostring(), linkedcommand = so302000.allocations.servicecommands.rownumber, commit = true }); ocmds.add(new value { value = dr["serial"].tostring(), linkedcommand = so302000.allocations.lotserialnbr, commit = true }); ocmds.add(new value { value = dpackqty.tostring(), linkedcommand = so302000.allocations.quantity, commit = true }); } else { ocmds.add(new value { value = "ok", linkedcommand = so302000.allocations.servicecommands.dialoganswer, commit = true }); ocmds.add(new value { value = dpackqty.tostring(), linkedcommand = so302000.allocations.quantity, commit = true }); } } ocmds.add(so302000.actions.save); //ocmds.add(po302000.documentsummary.totalqty); //ocmds.add(po302000.documentsummary.totalamt); oscreen.so302000submit(ocmds.toarray());
while trying change code handles non serial item use so302000.documentdetails.shippedqty instead of so302000.allocations.quantity, returns error: "px.data.pxrowpersistingexception: error #4: 'linetype' may not empty." not sure 1 means.
help appreciated :) g
please take look
content so302000 = context.getschema(); context.clear(); content[] result = context.submit( new command[] { new value { value = "001043", linkedcommand = so302000.shipmentsummary.shipmentnbr, commit = true }, new value { value = "000819", linkedcommand = so302000.documentdetails.ordernbr, commit = true}, new value { value = "ok", linkedcommand = so302000.binlotserialnumbers.servicecommands.dialoganswer, commit = true }, so302000.binlotserialnumbers.servicecommands.newrow, new value { value = "0-_", linkedcommand = so302000.binlotserialnumbers.subitem }, new value { value = "wr01", linkedcommand = so302000.binlotserialnumbers.location }, new value { value = "17snr000751", linkedcommand = so302000.binlotserialnumbers.lotserialnbr }, so302000.actions.lssoshiplinebinlotserial, so302000.actions.save } ); console.writeline();
Comments
Post a Comment