QBO API V3 : Product Inventory is not getting updated - intuit-partner-platform

We want to manually adjust/update the Inventory of an Item using QBO V3 API.
But, the QtyOnHand did not get updated on QBO properly. We re-checked using QBO browser app too.
First Request : Create a product of type "Inventory" on QBO with "QtyOnHand" set to 100.
a. The response appropriately mentioned that the product is created.
Second Request : Update the above product with "QtyOnHand" set to 200.
b. The response still contains the older QtyOnHand (100). It didn't reflect that new QtyOnHand.
How can we manually adjust / update QtyOnHand using QBO V3 API?
For reference, our update request is:
<IntuitBatchRequest xmlns="http://schema.intuit.com/finance/v3">
<BatchItemRequest operation="update" bId="0">
<Item>
<Id>2091</Id>
<SyncToken>0</SyncToken>
<Name>Product 26--var 2</Name>
<Description>false</Description>
<Taxable>true</Taxable>
<UnitPrice>1000.00</UnitPrice>
<Type>Inventory</Type>
<IncomeAccountRef>62</IncomeAccountRef>
<ExpenseAccountRef>111</ExpenseAccountRef>
<AssetAccountRef>112</AssetAccountRef>
<TrackQtyOnHand>true</TrackQtyOnHand>
<QtyOnHand>200</QtyOnHand>
<InvStartDate>2014-01-21</InvStartDate>
</Item>
</BatchItemRequest>
</IntuitBatchRequest>
Our response XML is:
<?xml version="1.0" encoding="UTF-8"?>
<IntuitResponse xmlns="http://schema.intuit.com/finance/v3" time="2014-01-20T23:21:44.559-08:00">
<BatchItemResponse bId="0">
<Item domain="QBO" sparse="false">
<Id>2091</Id>
<SyncToken>0</SyncToken>
<MetaData>
<CreateTime>2014-01-20T22:44:10-08:00</CreateTime>
<LastUpdatedTime>2014-01-20T22:44:10-08:00</LastUpdatedTime>
</MetaData>
<Name>Product 26--var 2</Name>
<Description>false</Description>
<Active>true</Active>
<FullyQualifiedName>Product 26--var 2</FullyQualifiedName>
<Taxable>true</Taxable>
<UnitPrice>1000</UnitPrice>
<Type>Inventory</Type>
<IncomeAccountRef name="Sales">62</IncomeAccountRef>
<PurchaseCost>0</PurchaseCost>
<ExpenseAccountRef name="Cost of Goods Sold">111</ExpenseAccountRef>
<AssetAccountRef name="Inventory Asset">112</AssetAccountRef>
<TrackQtyOnHand>true</TrackQtyOnHand>
<QtyOnHand>100</QtyOnHand>
<InvStartDate>2014-01-21</InvStartDate>
</Item>
</BatchItemResponse>
</IntuitResponse>

The QtyOnHand field is not an update-able field.
Inventory adjustments are made when:
You create a transaction that uses up inventory (Sales Receipts, Invoices, etc.)
You create a transaction that returns inventory (Credit Memos)
You issue an Inventory Adjustment (unfortunately, Intuit's API does not support this yet)
Given that the API does not support inventory adjustments yet, I don't think you'll be able to do what you're trying to do.

Related

WebMethods Integration Server pub.client.soapclient changes the request element names

I have an issue with build-in (non accessible) webMethods Integration Server soapClient service. Somehow it changes the request it should send while processing it, renaming parameter items to item.
what is send to the method:
<request>
<t1>1</t1>
<operation>op</operation>
<service>1</service>
<params>
<count>1</count>
<items>
<key>12</key>
<value>12</value>
</items>
</params>
</request>
what request webmethods sends:
<request>
<t1>1</t1>
<operation>op</operation>
<service>1</service>
<params>
<count>1</count>
<item>
<key>12</key>
<value>12</value>
</item>
</params>
</request>
I'd be grateful for any workaround/idea for a solution.
I see in your example code that you first create an document named "items", then you map this document to a document list named "items". This is not valid. Please note that the pipeline in IntegrationServer is nothing but a key-value map, and the keys must be unique. That is the reason why you still have a single document named "items" instead of a document list. Rename your document to something like "item", and then use appendToDocumentList to add it to the "items" doc list.

Unable to Add/Modify Mobile Phone field using IPP against QuickBooks desktop

I can't seem to modify or add the Mobile phone field in QuickBooks for QB Desktop. Online works fine, no dice in desktop but according to the XML response of the MOD request it seems to be working fine.
It shows the field being created/modified (idDomain is created, id value generated) however SyncManager never pushes the changes to QuickBooks.
I can modify the Mobile value on the QB side and I'll be able to see that change in my IPP application but no go when heading the other direction.
Here's the XML traces:
http://pastebin.com/qprwAh9z
Any ideas?
I was able to replicate this. The mobile phone number does not sync to the QB desktop file.Seems like a bug.
Please submit a support ticket here:
Link - http://developer.intuit.com/Support/Incident
It looks like, the problem is when you use 'Mobile' in the Phone's 'Tag' field.
Instead of 'Mobile', I tried 'Home' in the Tag field. As an alternate solution you can try the following (I will take a look if there is any constraint in the intermediate QBXML/QBSDK side )
IDS Req
<?xml version="1.0" encoding="UTF-8"?>
<Add xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" RequestId="22f39648c5ab1111988854e808163dc9" xmlns="http://www.intuit.com/sb/cdm/v2">
<ExternalRealmId>657117515</ExternalRealmId>
<Object xsi:type="Customer">
<TypeOf>Person</TypeOf>
<Name>SampleCust-IDS12</Name>
<Address>
...
</Address>
<Address>
...
</Address>
<Phone>
<DeviceType>LandLine</DeviceType>
<FreeFormNumber>0123456789</FreeFormNumber>
<Default>1</Default>
<Tag>Business</Tag>
</Phone>
<Phone>
<DeviceType>LandLine</DeviceType>
<FreeFormNumber>1234567890</FreeFormNumber>
<Default>0</Default>
<Tag>Home</Tag>
</Phone>
...
</Object>
</Add>
Create Response
<RestResponse xmlns="http://www.intuit.com/sb/cdm/v2">
<Success RequestId="22f39648c5ab1111988854e808163dc9">
<PartyRoleRef>
<Id idDomain="NG">1221097</Id>
<SyncToken>1</SyncToken>
<LastUpdatedTime>2013-07-19T11:25:43Z</LastUpdatedTime>
<PartyReferenceId idDomain="NG">1261065</PartyReferenceId>
</PartyRoleRef>
<RequestName>CustomerAdd</RequestName>
<ProcessedTime>2013-07-19T11:25:43Z</ProcessedTime>
</Success>
</RestResponse>
QBXML [ 2nd phone no is coming under AltPhone tag ]
<?qbxml version="9.0" ?>
<QBXML>
<QBXMLMsgsRq onError="continueOnError" newMessageSetID="13ff6ae6e2c76b59e49">
<CustomerAddRq requestID="EsbKeyMapHeader:1221097:0">
<CustomerAdd>
<Name>SampleCust-IDS12</Name>
..
<BillAddress>
...
</BillAddress>
<ShipAddress>
...
</ShipAddress>
<PrintAs>SampleCust</PrintAs>
<Phone>0123456789</Phone>
<AltPhone>1234567890</AltPhone>
<Fax></Fax>
..
</CustomerAddRq>
</QBXMLMsgsRq>
</QBXML>
QB's view [ There is no specific field for Mobile. Mobile/LandLine is kindOf Metadata. I'll check and confirm this behaviour ]
Thanks

Use Microsoft Dynamics CRM web service to get customized option set values

The CRM has some customized option sets, for example, Salutation option set is defined for Contact entity. I need to get values of this option set when creating or updating contacts. I tried to use RetrieveOptionSet request to get the option set values as below:
SOAP action to use http://schemas.microsoft.com/xrm/2011/Contracts/Services/IOrganizationService/Execute
SOAP request body
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<Execute xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<request i:type="a:RetrieveOptionSetRequest" xmlns:a="http://schemas.microsoft.com/xrm/2011/Contracts">
<a:Parameters xmlns:b="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
<a:KeyValuePairOfstringanyType>
<b:key>MetadataId</b:key>
<b:value i:type="c:guid" xmlns:c="http://schemas.microsoft.com/2003/10/Serialization/">00000000-0000-0000-0000-000000000000</b:value>
</a:KeyValuePairOfstringanyType>
<a:KeyValuePairOfstringanyType>
<b:key>RetrieveAsIfPublished</b:key>
<b:value i:type="c:boolean" xmlns:c="http://www.w3.org/2001/XMLSchema">true</b:value>
</a:KeyValuePairOfstringanyType>
<a:KeyValuePairOfstringanyType>
<b:key>Name</b:key>
<b:value i:type="c:string" xmlns:c="http://www.w3.org/2001/XMLSchema">my_type</b:value>
</a:KeyValuePairOfstringanyType>
</a:Parameters>
<a:RequestId i:nil="true" />
<a:RequestName>RetrieveOptionSet</a:RequestName>
</request>
</Execute>
</s:Body>
</s:Envelope>
The problem is that I can only use this request to get global option sets, but for customized option sets, this request just returns a not found error.
Does anyone knows how to get customized option set values?
EDIT: I'm using Java client to access Dynamics CRM web service. This is the final SOAP request body I used to successfully get option set values.
<s:Envelope>
<s:Body>
<Execute>
<request i:type="a:RetrieveAttributeRequest">
<a:Parameters>
<a:KeyValuePairOfstringanyType>
<b:key>MetadataId</b:key>
<b:value i:type="c:guid">00000000-0000-0000-0000-000000000000</b:value>
</a:KeyValuePairOfstringanyType>
<a:KeyValuePairOfstringanyType>
<b:key>RetrieveAsIfPublished</b:key>
<b:value i:type="c:boolean">true</b:value>
</a:KeyValuePairOfstringanyType>
<a:KeyValuePairOfstringanyType>
<b:key>EntityLogicalName</b:key>
<b:value i:type="c:string">contact</b:value>
</a:KeyValuePairOfstringanyType>
<a:KeyValuePairOfstringanyType>
<b:key>LogicalName</b:key>
<b:value i:type="c:string">my_type</b:value>
</a:KeyValuePairOfstringanyType>
</a:Parameters>
<a:RequestId i:nil="true"/>
<a:RequestName>RetrieveAttribute</a:RequestName>
</request>
</Execute>
</s:Body>
</s:Envelope>
The sample code in this page gave me useful information.
You need to use the RetrieveAttributeRequest, not the RetrieveOptionSetRequest.
The metadata for non-global(local) optionsets are defined as a part of the attribute on the entity itself, rather than as an entirely different structure. ie. if you delete your local optionset attribute from your entity, you lose all of the entire option set definition. But if it's a global optionset, deleting an attribute on a entity the references doesn't result in any loss of data for the option set
I think your question was answered a couple of months ago in this link:
Dynamics CRM - Accessing Custom Product Option Value
Please let me know if it is not the same, and we will try to find another way ;)
But thinking about you requirement again, and if I have understand it properly, how often is that option set going to change? Why don't you just retrieve the optionsets with the crmsvcutil.exe from the SDK?
Cheers,
Mario

what is the metadata attribute pair in MQFTE ? Why is it used?

I am working with wmqfte. While creating a transfer there is a parameter for metadata attribute pair. Why is this used for ?
One of the FTE engagements I worked on required email notifications of transfer status. Our approach to this was to add an email step in the transfer and the way we passed in the source and destination addresses was with metadata pairs. The transfer XML is provided below for an example:
<?xml version="1.0" encoding="UTF-8"?><request version="4.00" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FileTransfer.xsd">
<!DOCTYPE request>
<managedTransfer>
<originator>
<hostName>host.example.com</hostName>
<userID>me</userID>
</originator>
<sourceAgent QMgr="QMGR01" agent="AGENT01"/>
<destinationAgent QMgr="QMGR02" agent="AGENT02"/>
<transferSet priority="5">
<metaDataSet>
<metaData key="email.from">fteadmin#example.com</metaData>
<metaData key="email.to">"dept#example.com</metaData>
</metaDataSet>
<item checksumMethod="MD5" mode="binary">
<source disposition="delete" recursive="false">
<file>/root/path/file</file>
</source>
<destination exist="overwrite" type="directory">
<file>/root/path/</file>
</destination>
</item>
</transferSet>
<job>
<name>Your Job Name Here</name>
</job>
</managedTransfer>
</request>
A better way of sending status emails is to watch the transfer notifications published at the Coordination QMgr. However this example does show one possible use for the metadata pairs.

NSXMLParser : requesting guidance with making grouped tables from an RSS/XML feed

Im making a group table that is populated from an XML/RSS feed, ive managed to parse the data to the table just fine, but im stuck on how to make the table grouped?
ie, i want an events listing, and i want to organise the events in groups, using the Month for each group, how would i achieve this?
below is my XML structure, its pretty basic
<EventsUpcoming>
<Event id="1">
<month>July</month>
<title>Ian Moss</title>
<date>Saturday, July 1st</date>
<ticket>$35 On the door</ticket>
<description>
Ian Moss from Cold Chisel fame will be touring Australia and the only venue to secure him in Perth is the Blvd.
</description>
</Event>
<Event id="2">
<month>August</month>
<title>Cold Chisel</title>
<date>Saturday, August 3rd</date>
<ticket>$25 on the door</ticket>
<description>
From Khe San fame, Cold Chisel is back with the legendary Jimmy Barnes, dont miss out this gig. Its gonna go down in the books for sure!
</description>
</Event>
<Event id="3">
<month>September</month>
<title>Australian Crawl</title>
<date>Saturday, September 1st</date>
<ticket>Free</ticket>
<description>
They're one of Australia's most iconic band names, be sure to come down and check them out before they die.
</description>
</Event>
</EventsUpcoming>
If anyone knows any tutorial sites that might be helpful or just tips on how to go about doing this, thatd be much appreciated. Thanks in advance :)
NSMutableSet doesn't store the duplicate values,it only stores distinct ones.So at the time of parsing,you can use NSMutableSet to store the 'month' value of each xml element and set the number of sections in a tableview to the count of your NSMutableSet.