Miles Hart Posted September 23, 2024 Posted September 23, 2024 I'm adding a comment in our API to update a sales order line. (SODOCUMENTENTRY) https://developer.intacct.com/api/order-entry/order-entry-transactions/#update-order-entry-transaction-legacy Here is the Postman example <function controlid="{{$guid}}"> <update_sotransaction key="Sales order-SO-11XXXXX"> <updatesotransitems> <updatesotransitem line_num="1"> <memo>Testing1234</memo> </updatesotransitem> </updatesotransitems> </update_sotransaction> </function> Ideally we would like to use a number of query methods. However from the SDK it looks like the only one implemented. https://github.com/intacct/intacct-sdk-php/blob/a59195f2592f4c790cd9d156bffe69983b9a3387/src/Intacct/Functions/OrderEntry/OrderEntryTransactionLineUpdate.php#L57 Is this correct? Thank you Miles
Miles Hart Posted September 23, 2024 Author Posted September 23, 2024 Following up... Is this the correct way to update line entries?? $guid = uniqid(); $sop = new OrderEntryTransactionUpdate($guid); $sop->setTransactionId("Sales order-" . $sop_number); $sopLineEntry = new OrderEntryTransactionLineUpdate(); $sopLineEntry->setLineNo($line_number); $sopLineEntry->setPrice($price); $sop->setLines([$sopLineEntry]); $response = $this->_intacct_client->execute($sop); Is there a function that will output the XML before executing it? Thank you
Members Sterio, Louis Posted September 23, 2024 Members Posted September 23, 2024 Yes this is correct. This is the only supported and documented way to update line items.
Members Sterio, Louis Posted September 23, 2024 Members Posted September 23, 2024 Just now, Miles Hart said: Following up... Is this the correct way to update line entries?? $guid = uniqid(); $sop = new OrderEntryTransactionUpdate($guid); $sop->setTransactionId("Sales order-" . $sop_number); $sopLineEntry = new OrderEntryTransactionLineUpdate(); $sopLineEntry->setLineNo($line_number); $sopLineEntry->setPrice($price); $sop->setLines([$sopLineEntry]); $response = $this->_intacct_client->execute($sop); Is there a function that will output the XML before executing it? Thank you Yes all of the SDK's support logging: Sage Intacct SDK for PHP | Sage Intacct Developer
Miles Hart Posted September 23, 2024 Author Posted September 23, 2024 Thank you Louis, I did some deep debugging and found the PHP SDK requires you set the ItemId & Quantity as well as the price then it seems to start working. Otherwise it nulls these and the update says successful and doesn't update, so I'm presuming it either sets a new line somewhere... <updatesotransitems> <updatesotransitem line_num="4"> <itemid/> <quantity/> <price>300.02</price> </updatesotransitem> </updatesotransitems> I'm also seeing this is a very slow update. If I run the Postman against SageIntacct Update Order Entry Transaction (Legacy) example, I'm seeing 28 seconds....?
Miles Hart Posted September 23, 2024 Author Posted September 23, 2024 Another update... & summary 1. https://github.com/intacct/intacct-sdk-php/blob/master/src/Intacct/Functions/OrderEntry/OrderEntryTransactionLineUpdate.php On line #60 & #64 there is a "writeNull" is set to true, which is putting in the extra XML elements. Is there a reason for this? I'd like to remove them as these are causing a null element and breaking the Sales Order. 2. Can someone explain the 15 second delay to update a line? Thank you Miles
Miles Hart Posted October 1, 2024 Author Posted October 1, 2024 I've found the culprit for issue #2, it is waiting for triggers.
Recommended Posts