QBD Query Item by Name (DevKit) - quickbooks

How to query an item by name? I thought this might work the same as looking up a customer by name, but it seems like not.

For .net you can refer to the class library documentation here:
http://developer-static.intuit.com/SDKDocs/QBV2Doc/IntuitDataServicesSDK/
If you go to ItemQuery, you will se it exposes ItemElementName of return type ItemChoiceType4 enum.
If you go to the ItemChoiceType4 details, You will see it exposes, IteratorId and StartPage.
As mentioned above, Items cannot be queried by name.
Similarly for customer query on name, you can get details that it exposes Item1ElementName which returns Item1ChoiceType enum.
For all entities similarly you can search.
Using items will not be so elusive then. :)
Also, for each entity for QBD, you can reference the docs too and refer to Query Attributes section for details.
https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v2/0500_quickbooks_windows/0600_object_reference

QBD Items can't be retrieved by name
Ref QueryFilter Docs -
https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v2/0500_quickbooks_windows/0600_object_reference/item#Retrieving_Items_Using_a_Query_Filter

Related

Graph Bookings API - List appointment returning empty customers array

When invoking either
GET /solutions/bookingBusinesses/{id}/calendarView
or
GET /solutions/bookingBusinesses/{id}/appointments
the returned bookingAppointment object has an empty customer array. However the customers appear in the UI. Any idea why this may be the case?
Looks like a bug in Graph API.
According to the documentation the customers property is optional. Sometimes you have to specify optional property in $select statement.
GET solutions/bookingBusinesses/{id}/calendarView?start=2018-04-30T00:00:00Z&end=2018-05-10T00:00:00Z&$select=customers
Another option is trying beta version instead of v1.0
GET beta/solutions/bookingBusinesses/{id}/calendarView?start=2018-04-30T00:00:00Z&end=2018-05-10T00:00:00Z

ExtJs6: Ext.ComponentQuery.query('#autogenerated_id') returns an empty array if the component has an itemId

I have some ExtJs component.
I set itemId for it, but id is autogenerated.
Now Ext.getCmp('autogenerated-id') returns my component.
But Ext.ComponentQuery.query('#autogenerated-id') returns an empty array.
But:
Ext.ComponentQuery.query('[id=assets-information-form-1918]') again returns my component. :)
I use ExtJs 6.5.3 classic.
It seems like itemId config property hides autogenerated id from Ext.ComponentQuery, so they become mutually exclusive.
I don't need other means for search or advice to set id for the component, to write letter to Sencha support or to write post on their forum.
I need:
Means to force my Ext.ComponentQuery.query('#autogenerated-id') to
find the Component for which getId() returns 'autogenerated-id'.
If it is not possible by design, I need a link to some documentation
describing this behavior, a link to some bug report, or a filename and line number in ExtJs sources + a little snippet copy/paste from there.
From the documentation
Summary Provides searching of Components within Ext.ComponentManager
(globally) or a specific Ext.container.Container on the document with
a similar syntax to a CSS selector. Returns Array of matching
Components, or empty Array.
Ext.ComonpentQuery.query('#itemId') returns and array. Your cold above is using the auto-generated id of the component. The # indicates to query based on the component itemId and not the component id.
Try
Ext.ComponentQuery.query('assets-information-form-1918');
which will return an array, as noted in the documentation.
Ext.getCmp()
This is shorthand reference to Ext.ComponentManager#get. Looks up an
existing Ext.Component by id
Therefore it returns the component object.
Ext.ComponentQuery.query('#itemId')[0] would return the first object in the array.
Ext.ComponentQuery is the Sencha preferred method because it is more powerful when used as it does return an array so you an also query items by xtype and other attributes.

Listing appointments of a contact

I'd like to list the appointments that a contacts is set to as a required participating party. I'm running the following query in my organization.
The service end point is set up like so.
https://bazinga/XRMServices/2011/OrganizationData.svc/AppointmentSet?
And then I concatenate that with the following.
$select=
ScheduledStart,
ModifiedOn,
appointment_activity_parties/PartyId
&$top=1000
&$filter=
ModifiedOn gt DateTime'2014-08-21'
&$expand=appointment_activity_parties
This gives me a list of a few appointments and when I investigate the contents, I can clearly see a tag called PartId with Id, Name etc. in it. The infromation is there. Then I check by hand the guid of the contact I'm curious about and add another condition in the filter specifying it.
$select=
ScheduledStart,
ModifiedOn,
appointment_activity_parties/PartyId
&$top=1000
&$filter=
(ModifiedOn gt DateTime'2014-08-21')
and (appointment_activity_parties/PartyId eq guid'...')
&$expand=appointment_activity_parties
However, the stupid organization service says that no property PartyId exists. When I try adding /Id, it says something about no support for complex data types when querying. I'm sure it's just a small syntax thingy but after a few hours and sick and tired. What do I miss?!
Your scenario behind the clause (appointment_activity_parties/PartyId eq guid'...') is that you want to find out appointments in the Appointmentset the PartyId of whose appointment_activity_parties equals a certain GUID. But you need to specify do you want to return the appointment if the PartyId of any of its appointment_activity_parties equals that GUID, or you want to return the appointment only when all of the PartyId of its appointment_activity_parties equals that GUID.
This any and all difference is specified in the section 5.1.1.2 of OData V4 Protocol part 2: URL Conventions.
Thus, you can rewrite your query as follows:
$select=
ScheduledStart,
ModifiedOn,
appointment_activity_parties/PartyId
&$top=1000
&$filter=
(ModifiedOn gt DateTime'2014-08-21')
and (appointment_activity_parties/any(a:a/PartyId eq guid'...'))
&$expand=appointment_activity_parties
And you can choose modify the any to all according to your actual needs.

Any reason for URLEncodedUtils.parse return List< NameValuePair >

https://hc.apache.org/httpcomponents-client-4.3.x/httpclient/apidocs/org/apache/http/client/utils/URLEncodedUtils.html#parse(java.net.URI,%20java.lang.String)
why not return Map< String, List< String > >
if it returns Map, user can easily query by key to get whatever they want.
otherwise user should iterator the whole list to find what they want.
Thanks
Because this is a list. If you read carefully the explanation, says:
Returns a list of NameValuePairs as built from the URI's query portion. For example, a URI of http://example.org/path/to/file?a=1&b=2&c=3 would return a list of three NameValuePairs, one for a=1, one for b=2, and one for c=3.
That means that you cannot use a list to acces by value, because these type of data structures aren't designed for that. They doesn't have any "key" to use.
In this website, Jon Skeet wrote a very clear answer about you cannot use a shortcut to acces a List<NameValuePair> value using a name or a key or for similar structures.
Here you can check the post: Get ArrayList<NameValuePair> value by name
Inside of the same post, you'll see different options to solve your problem. (Or could guide to you to find the solution)

QBFC: How do I query the customners by accountnumber?

Since Intuit has broken the QBFC reference today, I have to ask a question that I could normally look up. (I do not know who to complain to).
I normally query by list_id like so:
ICustomerQuery CustomerQueryRq = requestMsgSet.AppendCustomerQueryRq();
CustomerQueryRq.ORCustomerListQuery.ListIDList.Add(qb_list_id);
Is there a way to query by AccountNumber?
Thanks!
No, QuickBooks does not support querying by the AccountNumber field.
This is old, but maybe worth adding.
Create a temp "cached" object, containing all the properties you want to search for. Them when launching, and whenever customer changes are made, cache a list of custom QBcustomersForSearch objects with only the properties that you would want to use for the search.
class qbCustomerForSearch
property email as string
property accountnumber as string
property whatever as string
property QBListId as string
end class
Cache / create a list of these objects when and as needed, and search your list. Once located in your list, use the listID to identify the QB customer.
Cheers

Resources