When updating records in QuickBooks Online through Codat you may run into an error like the following:
Failed to update {Datatype} as it has been modified since the last sync.
You may need to re-sync the {Datatype} data.
This article covers 2 ways to resolve this.
Audience
This article is intended for users comfortable pushing data to QBO.
Pre-requisites
If there are any pre-requisites to implementing this knowledge article.
For example, the user must be an Admin user on the machine to perform some of these steps, the reader must be a Codat portal Developer or Admin, the reader must have access to the developer app, the reader must have access to the API keys.
QuickBooks Online - Pushing Updates to Records
When updating records in QuickBooks Online through Codat you may encounter the following error:
Failed to update {Datatype} as it has been modified since the last sync.
You may need to re-sync the {Datatype} data.
When this occurs it indicates that Codat has detected that the record in QuickBooks Online has had changes made to it more recently than the changes in the latest dataset pull for that datatype. I.e. the sourceModifiedDate Codat has stored is earlier than the sourceModifiedDate QBO is currently reporting. Codat provides this error to indicate that you may be pushing stale data to this record.
To give a real world example of this: A sync is completed on the 1st of the month and Codat stored the date the record was last modified in QBO (sourceModifiedDate) as the 1st. The user makes a change within QBO to that record on the 2nd. On the 5th when pushing an update to that record Codat detects that the record was modified on the 2nd and reports this error.
There are two ways to work around this.
- Queue a sync for that dataset. This will update the record in Codat and you can use the new data as the basis of your push.
- If you're sure that the data you have is correct and you wish to overwrite what is in QBO you can include the forceUpdate=true query parameter in your request URL. An example of this is provided below;
This will ignore the error previously provided and force the changes you have to QBO.https://api.codat.io/companies/{CompanyId}/connections/{ConnectionId}/push/invoices/{InvoiceId}?forceUpdate=true
If you have any questions on the information shared above, contact support@codat.io.