0

I have added one item with custom fields colour and material in QuickBooks desktop. How can I get that custom field's value using XML. I have found DataExtDefQuery in OSR but don't know how to use it for multiple custom fields. I want to get custom fields for a particular item only.

Thanks.

Jack
  • 3
  • 6

1 Answers1

0

Do an ItemQuery, and make sure you specify <OwnerID>0</OwnerID>. Specifying that OwnerID will tell QuickBooks to return the custom fields.

<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="13.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<ItemQueryRq metaData="ENUMTYPE" iterator="ENUMTYPE" iteratorID="UUIDTYPE">
<!-- BEGIN OR -->
<ListID >IDTYPE</ListID> <!-- optional, may repeat -->
<!-- OR -->
<FullName >STRTYPE</FullName> <!-- optional, may repeat -->
<!-- OR -->
<MaxReturned >INTTYPE</MaxReturned> <!-- optional -->
<!-- ActiveStatus may have one of the following values: ActiveOnly [DEFAULT], InactiveOnly, All -->
<ActiveStatus >ENUMTYPE</ActiveStatus> <!-- optional -->
<FromModifiedDate >DATETIMETYPE</FromModifiedDate> <!-- optional -->
<ToModifiedDate >DATETIMETYPE</ToModifiedDate> <!-- optional -->
<!-- BEGIN OR -->
<NameFilter> <!-- optional -->
<!-- MatchCriterion may have one of the following values: StartsWith, Contains, EndsWith -->
<MatchCriterion >ENUMTYPE</MatchCriterion> <!-- required -->
<Name >STRTYPE</Name> <!-- required -->
</NameFilter>
<!-- OR -->
<NameRangeFilter> <!-- optional -->
<FromName >STRTYPE</FromName> <!-- optional -->
<ToName >STRTYPE</ToName> <!-- optional -->
</NameRangeFilter>
<!-- END OR -->
<!-- END OR -->
<IncludeRetElement >STRTYPE</IncludeRetElement> <!-- optional, may repeat -->
<OwnerID >GUIDTYPE</OwnerID> <!-- optional, may repeat -->
</ItemQueryRq>

See the OSR: https://developer-static.intuit.com/qbsdk-current/common/newosr/index.html

Keith Palmer Jr.
  • 27,666
  • 16
  • 68
  • 105
  • Thanks for the reply. Now I've another query. I'm able to get custom fields using this but suppose there's one item which has two custom fields. So in return, I'll get two DataExtRet nodes. I tried to loop over the response but I'm not able to get all the custom fields data. Loop only retrieves first DataExtRet node. It doesn't retrieve the second one. I tried many ways but still no luck. – Jack May 18 '19 at 06:29
  • So make a new post, and POST YOUR CODE, and maybe we can help you? – Keith Palmer Jr. May 18 '19 at 11:14