Friday 15 February 2013

quickbooks - QBO SDK C# - Asynchronously Batch Process Create Multiple Customer -


I want to include the mulitple client object. I followed this link but received the following error - "You only have one Once you can add names or edit, please try again. "


Posting my code:

  Using the system; Using System.Collections.Generic; Using System.configuration; Using System.Globalization; Using System.Web; Using Intuit.pp.Core; Using Intuit.Ipp.Security; Intuit.pp. Using the service; Using HelloIntuitAnywhere.Utilities; By using Intuit.pp.Data.Qbo; Using Intuit.ipp.Data.Extensions; Using System.Linq; Using System.IO; Using Intuit.pp.Data; Namespace HELOEIRIFE anywhere {public partial batchRequest: system. Web. UI Page {Public Representative IntuitBatchResponse DelegateBatchCompleted (IntuitBatchRequest BatchQuake); Protected Zero Page_Load (Object Sender, EventArgues E) {If (HTTPPT. Projection. Current session.cas; gt; 0) {string reload ID = http Contex. Running Session ["Realm"]. Toasting (); String accessToken = HTPCNtex Present. Session ["AccessToken"]. Toasting (); String AccessTextCert = HTTPNTEX Running Session ["AccessToken Secret"] Toasting (); String Consumer = Configuration Manager Apps ["Consumer"]. Toasting (Culture Info. Invent Culture); String ConsumerCit = Configuration Manager App Settings ["ConsumerCycture"] Toasting (Culture Infographic Inviative Literature); IntuitServicesType intuitServiceType = (IntuitServicesType) HttpContext.Current.Session ["intuitServiceType"]; OAuthRequestValidator oauthValidator = New OAuthRequestValidator (AccessToken, AccessToken Secret, Consumer, ConsumerSoftware); ServiceContext Reference = New Service Tracking (oauthValidator, realmId, intuitServiceType); DataServices General Services = New Data Services (Reference); Try {Switch (Internet Service Service) {Case IntuitServicesType.QBO: IntuitBatchRequest Batchrostest = New IntuitBatchRequest (); BatchRecord Batch itam = new batchyamerivist [10]; For (int i = 0; i <-10; i ++) {item itm1 = CreateItem ("it8" + i.ToString ()); String guid = Guid.NewGuid (). ToString ("N"); Guid = guid.Substring (0, 30); Guid = i.ToString (); BatchIightRequest ITM1 batch ITEM = new batchaimrext (); Itm1BatchItem.bId = guid; Itm1BatchItem.Item = itm1; Itm1BatchItem.operation = OperationEnnam.co.uk; Itm1BatchItem.operationSpecified = True; Batchrequest Batch item [i] = ITM1 batch item; } // IntuitBatchResponse Batch Response = General Services Extechbatch & lt; IntuitBatchRequest & gt; (Batchrequest); {DelegateBatchCompleted delegateBatch = New DelegateBatchCompleted (commonService.ExecuteBatch & lt; IntuitBatchRequest & gt;); IAsyncResult Results = delegateBatch.BeginInvoke (BatchQuake, New AsyncCallback (CallbackMethod), delegateBatch); } Hold (Exceptional) {East; } break; Default: New exception throw ("Data source is not defined."); }} Hold {throw; }}} Private Intuit.ipp.Data.Qbo.Item CreateItem (string str) {Intuit.ipp.Data.Qbo.Item Item = New Intuit.ipp.Data.Qbo.Item (); Item.Desc = str + "test disco"; Item.Name = str + "test name"; Item.Taxable = true; Item.Taxable Specified = True; Item.ExternalKey = New Intuit.ipp.Data.Qbo.IdType () {idDomain = Intuit.ippp.Data.Qbo.idDomainEnum.QBO, value = str + "123"}; Item.UnitPrice = new Intuit.ipp.Data.Qbo.Money () {amount = 6, the amount is specified = true, CurrencyCode = Intuit.pp.Data.Qbo.currencyCode.AED, CurrencyCodeSpecified = false}; Item.IncomeAccountRef = new Intuit.ipp.Data.Qbo.AccountRef () {AccountID = New Intuit.ipp.Data.Qbo.IdType () {idDomain = Intuit.pp.Data.Qbo.idDomainEnum.QBO, Value = "1 "}, AccountType = Intuit.ipp.Data.Qbo.AccountTypeEnum.Asset, AccountType displayed = true}; item. Type = Intuit.pp.Data.Qbo.ItemTypeEnum.Assembly; Object back; } Fixed zero callback method (IAsyncResult result) {DelegateBatchConpleted delegateBatch = (DelegateBatchCompleted) results. AsyncState; IntuitBatchResponse Batch Response = Delibate Batch. And invoke (result); Error message is quite clear: Quickbooks API only permits a customer. Gives it to be edited in a timely manner.  

They potentially lock the customer table because concurrent edits are not supported by the business level or the underlying data model.

Given this restriction, there is no way around the problem.

They allow synchronous method to call Asynchronously so that you do not have to block until the method is completed, but that does not mean that you can be in the editing of two customers at the same time. Still you can do other things when editing is complete.

No comments:

Post a Comment