Search code examples
asp.netc#-4.0quickbooksintuit-partner-platformquickbooks-online

Quick Book Error You and sam working on this at the same time


I am trying to update the data in quick book while updating i am getting exception as follows

"You and sam were working on this at the same time. sam finished before you did, so your work was not saved." I have attached the screenshot for your reference. Please let me know if you need any detailed explanation about this issue. Any help would be appreciated.

Code

  oBillHeader.VendorId = new IdType() { idDomain = idDomainEnum.QBO, Value = vendorID };
  oBillHeader.VendorName = vendorNameVal;
  oBill.Header = oBillHeader;
  oBill.Line = oBillLineList.ToArray();
  oBill.Id = new IdType { idDomain = idDomainEnum.QBO, Value = Convert.ToString(ViewState["ReponseBillId"]) };
  oBill.SyncToken = "2";
  var oNewBill = service.Update(oBill);

Image:

enter image description here


Solution

  • Please read the latest sync token of the object and use the same in the update query.

    Relevant docs on SyncToken values:

    Thanks