ItemInventoryQuery is not returning all the available fields. - qbxml

We are using Web Connector on the end where QBPOS 10.0 is installed.
On the server end we issue an ItemInventoryQuery request using QBPOSFC3.0 (QB POS Foundation Classes).
The response we receive from Quickbooks contains most of the fields available on an inventory item, but there are some fields that are not being returned, specifically, "Unit of Measure" is not being returned on the XML we receive from Quickbooks.
Per the on screen reference, the "UnitOfMeasure" is a field available on the response of an ItemInventoryQuery
https://member.developer.intuit.com/qbsdk-current/Common/newOSR/index.html
Nonetheless I am unable to obtain these values, the "UnitOfMeasure" nodes do not even exist on the XML response we get from Quickbooks, everything else is good in the response (e.g. item ListID, name, vendor, etc.)
What am I missing here ?
Here is a sample of the XML response we receive:
http://pastebin.com/pA6KDr0k

I just checked some of my old source code and found that I was explicitly telling it which fields to return. For example:
query.IncludeRetElementList.Add("UnitOfMeasure1");
query.IncludeRetElementList.Add("UnitOfMeasure2");
query.IncludeRetElementList.Add("UnitOfMeasure3");
I don't remember if I did this because of the same problem you're having, but I do know I got the UOM fields in the response. Hope this helps!

Check unit of measure is enabled for the company file in preferences -> items & inventory -> Company preferences tab. It is disabled by default in new companies.

You are missing other fields too such as time created.
If you included any IncludeRetElementList lines in your request that will limit your results.
So You will have to add IncludeRetElements for UOM as Mike suggested.
If that doesn't work I'd suggest posting your request.

Related

Power Automate - Update Work Item Error - Response in JSON Format -Azure Devops

I am getting an exception when I am trying to update an existing work item description with a link of SharePoint file in power automate. This SharePoint file had been created when an email with the attachment was received.
Please have a look at the flow and exception below
Can anyone please help me understand the issue?
Thanks,
Bee
It looks like you entered a wrong variable for the field Work Item Id. The field Work Item Id for step Update a work item should be the id of the work item to update.
I saw you set the field Work Item Id to variable {x}workItemUrl. If variable workItemUrl is not the work item id. The automate flow will fail with above error.
You can also check the log to see if the values you specified in the fields are correct.

Is there a way to assign the primary category for a product in demandware using the Open Commerce API (OCAPI)?

The primary category of a product is present in the product document (primary_category_id) in the DATA API but cannot be written. After sending a PATCH update of the product with a different primary_category_id, it doesn't change.
Is there a way of doing this through the OCAPI?
Can be some limitation for PATCH Method.Fields that can be updated:
name,
page_description,
long_descripton,
page_title,
page_keywords,
brand,
ean,
upc,
manufacture_sku,
manufacture_name,
searchable,
unit,
searchable,
online_flag,
default_variant_id.
Try with PUT Method. PUT https://hostname:port/dw/data/v19_1/products/{id}. Also,
please check Request Document.
At this time it does not appear that this is possible to manage via OCAPI.
I suspect that in the future you'd be able to achieve it using the following resources:
DELETE /catalogs/{catalog_id}/categories/{category_id}/products/{product_id}
followed by:
PUT /catalogs/{catalog_id}/categories/{category_id}/products/{product_id}
With a ProductCategoryAssignment document in the PUT call.
However, this would require that Salesforce adds those attributes to the ProductCategoryAssignment document.
The reason I suggest this is where it would be added is that within a catalog import document (XML) the flags are associated with a similar resource representation. eg:
<category-assignment category-id="gear-bags-backpacks" product-id="NSF4003100">
<primary-flag>true</primary-flag>
</category-assignment>

Clio API - What is the correct format to Update (PATCH) a custom field value for a matter

Anyone been able to successfully update the custom_field_values for a matter via Clio's API?
I'm trying to update the value for custom_field_values under a single matter. I'm able to send a JSON string using PATCH and update the default values for a matter like location or description using the following format
{"data":{"location":"Orange"}}
But when it comes to updating a "custom field value" I'm getting a 422 Unprocessable Entity error. I'm following Clio's v4 API Documentation and my understanding is that to update a custom_field_value you need the following JSON:
{"data":{"custom_field_values":[{"id":658213,"custom_field":{"id":139385},"value":"New Value Goes Here!"}]}}
However here is the message coming with the 422 error:
{"error":{"type":"ArgumentError","message":"An invalid argument was supplied: invalid custom field value id provided, acceptable format is <type>-<unique id>"}}
I can't interpret the part suggesting the acceptable format!
I've also tried sending the JSON in the following format which is closest to Clio's V2 API Docs for updating a custom field:
{"data":{"custom_field_values":[{"custom_field":{"id":139385},"value":"New value goes here"}]}}
But then this is what I get back:
{"error":{"type":"ArgumentError","message":"An invalid argument was supplied: custom field value for custom field 139385 already exists"}}
Please note that this is being tested in POSTMAN regardless of my development environment. I appreciate your response!
I've successfully created queries to update custom field values in matters many times, and these run all the time for me. I've compared your json to some examples of the json I'm successfully sending. Your syntax appears correct, but there's enough missing for me to only guess at where your mistake might be.
First, you're sending a PATCH to https://app.clio.com/api/v4/matters/{matter id}.json right? It took me a while to learn that you can't update the value of a matter's custom field with a query to https://app.clio.com/api/v4/custom_fields/{id}.json.
Second, just to clarify, the 658213 id you used above (the first id field) should be the unique id of this instance of your custom field. You won't get this until you've created an instance of the custom field particular to this matter. The second id field, where you've put 139385 is the id for the custom field itself, which you could get with a query to https://app.clio.com/api/v4/custom_fields.json.
If you're looking in the V.4 docs under Custom Fields, you won't find this, or at least I didn't. BUT you can find it in the intro section to the Matters portion fo the documentation: https://app.clio.com/api/v4/documentation#tag/Matters
Hope this helps. I'd imagine someone at Clio could help by verifying your error string is delivered when you have an incorrect custom field value unique id.
To further clarify Jacob's answer for everyone else:
custom_field{id} is the id given to a custom_field when it's created and will be the same for all matters or contacts it's used in.
custom_field_value{id} is the id given to an instance of the custom_field added to a particular matter and unique only to that matter
To add a custom_field to a matter for the first time the following format is used:
{"data":{"custom_field_values":[{"custom_field":{"id":123456},"value":"string or integer depending on the type of CF"}]}}
To update a custom field already added to a matter the following format should be used:
{"data":{"custom_field_values":[{"id":"text_line-1234567", "custom_field":{"id":123456},"value":"string or integer depending on the type of CF"}]}}
To delete a custom field already added to a matter the following JSON format is sufficient:
{"data":{"custom_field_values":[{"id":"text_line-1234567", "custom_field":{"id":123456},"_destroy":true}]}}
Format for updating a custom field already added to a matter:
{"data":{"custom_field_values":[{"id":"unique_instance_of_your_custom_field", "custom_field":{"id":'custom_field_id'},"value":"value which should be updated"}]}}
Here, the first id field should be the unique id of this instance of your custom field. To get this value follow this documentation section, app.clio.com/api/v4/documentation#tag/Matters and the second id field is the id for the custom field itself.

How do I export GLBudgetLineDetail via Rest API?

My goal is to export data from the [GLBudgetlineDetail] table via the Rest API.
To accomplish this:
1) I created created a custom endpoint based on the Budgets screen (Finance > General Ledger > Work Area > Enter > Budgets)
!(http://imgur.com/sQC0zOI)
2) I populated the endpoint by adding all the fields from the Budget Articles container
!(http://imgur.com/tZp2GMh)
When I query this endpoint, I only get an empty array returned "[]".
Here is the query:
GET http ://servername/WebServiceAPITest/entity/MyStore/6.00.001/Budget
Headers:
Content-Type -> application/json
("Budget" is the name I gave to the endpoint)
I can successfully query other endpoints (Accounts, Vendors, JournalTransactions, etc) but I can't get any data back from this one.
I created the MyStore Demo (Course I210) and have access to the [GLBudgetLineDetail] table and can verify that it has data. On the Budgets screen, if I filter to year 2013, Ledger 'Budget', Branch 'SOFT', I can see Budget information.
How do I get access to this info via the Rest API?
Since you mentioned the Course I210, You might want to refer yourself to the section 3.4.1 about Retrieving the Price of an Item for a Customer.
In that section, they are saying that if you want to retrieve data from an inquiry, you must use the Put command:
"Because you are retrieving the price of an item from the inquiry, you will use the Put() method to obtain data."
Since the Budget Screen is an Inquiry Screen you must use the Put command to set the parameter you want.
Here is one that I tried and that worked on an Acumatica web site with demo
data:
PUT http://localhost/Demo610u04/entity/BudgetEndpoint/6.00.001/Budget
Headers (Key -> Value):
Content-Type -> application/json
Accept -> application/json
Body :
{
"BudgetArticles":[{}],
"FinancialYear":{"Value":"2016"},
"Ledger":{"Value":"BUDGET"}
}
EDIT: Looking at the image you added, you should have your budget Filter fields in the main entity and have a sub entity of type Detail containing the Budget Articles fields

Issue with Vendor and Employee Business Rules

According to the documentation, there is a Business Rule for Vendor and Employee that says
The name, first name, or last name field should not be blank.
Considering that NAME is required for create, the question is ¿Does this mean that ALL three properties have to have a value on Create?
We understood that, so we ran some tests. Creating a record with the three properties populated has no problem. The issue comes when we try so insert a null value for GivenName and FamilyName (first name and last name).
Quickbooks seems to take the NULL values as valid, and when inserting the record is not returning any error. The problem is that the record that was inserted never shows in the QBD UI, but is seems like it persists somewhere, because if we try to insert it again we get a "duplicate name" error.
Not sure if this is an issue or an expected behaviour... Any hints??
Thanks
QuickBooks for windows has some legacy behavior to be aware of. The First, Last and Name combines for a unique identifier accross Customers, Vendors and Employees. So you should fill in ALL the information you have. Any attempts to insert a record with the same F or L name, will fail if there is a Customer, Vendor or Employee with the same F & L.
Second, you mentioned that the record doesn't show in QuickBooks for Windows?
Did it sync successfully? Did you check the error state of the record you inserted?
Did you look at the sync logs to see if it failed to sync?
Lastly, you need to check all three objects for a user with the same F & L name if you are getting a duplicate error. Normally you would check to see if the customer/vendor/employee exists firsts so you can update the existing or determine if it is in fact a new record.
hope that helps
Jarred