Miles Hart Posted August 22 Share Posted August 22 We have a custom field added to our Sales Orders (SODOCUMENT) called PLOT as a Text type. This showing and we're able to add data through the UI. However when read this object VIA the API, this field is not being returned. I as using the Sage PHP SDK, and basic code: $where1 = new EqualToString(); $where1->setField('DOCNO'); $where1->setValue($doc_id); $query1 = new ReadByQuery(); $query1->setObjectName("SODOCUMENT"); $query1->setQuery($where1); Am I missing something? Link to comment Share on other sites More sharing options...
Members Sterio, Louis Posted August 23 Members Share Posted August 23 The SODOCUMENT object represents all header-level Order Entry transaction types. Each transaction type, such as "Sales Order" or "Sales Invoice," can have its own custom fields. To specify which type of Order Entry transaction you're querying, use the docparid field. For example: <content> <function controlid="testControlId"> <readByQuery> <object>SODOCUMENT</object> <fields>*</fields> <query></query> <returnFormat>xml</returnFormat> <pagesize>100</pagesize> <docparid>Sales Invoice</docparid> </readByQuery> </function> </content> This query will return the custom fields specific to the "Sales Invoice" transaction type. If the SDK doesn't support this out-of-the-box, you may need to extend the SDK to handle it, as it ultimately generates XML requests like the one above. Link to comment Share on other sites More sharing options...
Preston, Charlie Posted August 27 Share Posted August 27 In the ReadByQuery class there is a function called setDocParId - try calling that with the appropriate type. https://github.com/intacct/intacct-sdk-php/blob/master/src/Intacct/Functions/Common/ReadByQuery.php 1 Link to comment Share on other sites More sharing options...
Miles Hart Posted September 5 Author Share Posted September 5 I appreciate the support... all working now. I had to get the case correct otherwise nothing returns... I'm amending my solution for the next person 🙂 $where1 = new EqualToString(); $where1->setField('DOCNO'); $where1->setValue($doc_id); $query1 = new ReadByQuery(); $query1->setObjectName("SODOCUMENT"); $query1->setDocParId("Sales order"); $query1->setQuery($where1); I'm guessing this ties back to object inheritance? Link to comment Share on other sites More sharing options...
Preston, Charlie Posted September 5 Share Posted September 5 Yes, have a look at the SDK documentation, here: https://intacct.github.io/intacct-sdk-php/class_intacct_1_1_functions_1_1_common_1_1_read_by_query.html Link to comment Share on other sites More sharing options...
Recommended Posts