-
Notifications
You must be signed in to change notification settings - Fork 38
Description
When creating, updating, and deleting results using the following classes, the Result object within the OnlineResponse object returns an empty array:
/src/Intacct/Functions/OrderEntry/OrderEntryTransactionCreate/src/Intacct/Functions/OrderEntry/OrderEntryTransactionUpdate/src/Intacct/Functions/OrderEntry/OrderEntryTransactionDelete
More specifically, OnlineResponse::$results[0]->data is empty when in fact something should be returned. This is important because it would help to receive the value of DOCID so that follow-up requests could be made. This is especially important for OrderEntryTransactionCreate to return the value so that follow-up requests could be made using either OrderEntryTransactionUpdate or OrderEntryTransactionDelete when needed.
As an interim solution, users would have to make a wasteful Query, searching for the SODOCUMENT object that was just created in order to get the value DOCID.
I did some research into why an empty array was being returned, and it's because the <key> isn't wrapped in a <data> element and/or <SODOCUMENT> element, which I believe the SDK (or response handler) is expecting with the response that's returned. Here's a sample of what the <result> element looks like as returned by OrderEntryTransactionCreate:
<result>
<status>success</status>
<function>create_sotransaction</function>
<controlid>[REDACTED]</controlid>
<key>Sales Order-[REDACTED]</key>
</result>
Here's a sample of what gets returned by other requests when Result::$data is NOT empty:
<result>
<status>success</status>
<function>query</function>
<controlid>[REDACTRED]</controlid>
<data listtype="SODOCUMENT" totalcount="1" offset="0" count="1" numremaining="0">
<SODOCUMENT>
<RECORDNO>[REDACTRED]</RECORDNO>
<DOCNO>[REDACTRED]</DOCNO>
<DOCID>Sales Order-[REDACTRED]</DOCID>
<DOCPARID>Sales Order</DOCPARID>
</SODOCUMENT>
</data>
</result>
It would also be nice if RECORDNO were returned when creating a sales order in addition to DOCID in case it might be needed for something.