web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested Answer

Getting Sync Error Wile downloading data from crm server to field service mobile(Xamarin) APP

(0) ShareShare
ReportReport
Posted on by 189

HI I am facing Below issue while syncing   downloading data from crm server to field service mobile(Xamarin) APP.

UNIQUE constraint failed: incident.incidentid

Below is  full sync log 

SyncStart:2022-01-06 15:27:07-05:00

License: Valid
Customization NOT MODIFIED
<GetCustomization Tim=406/>
Exception while syncing: incident

<EXCEPTION>2022-01-06T15:28:24.8322882-05:00: SqliteException: Abort due to constraint violation
UNIQUE constraint failed: incident.incidentid
at SQLite3.PrvStep(Data.Sqlite3.SqliteStatement stmt)
at SQLite3.Step(Data.Sqlite3.SqliteStatement stmt)
at Resco.Data.SQLite.SQLiteDatabase.ExecuteSingleNonQuery(String query, Collections.Generic.IEnumerable<Object> parameters)
at Resco.Data.MultiInsertDataRecord.Flush()
at Resco.Data.MultiInsertDataRecord.Add(Data.InsertDataRecord rec)
at Resco.Data.MultiInsertDataRecord.Add(Data.IWritableDataRecord rec)
at SyncEngine.ClientBasedSyncTable(Data.db, Data.Synchronization.TableSyncAnchor anchor, Data.MetaEntity meta, Data.WebService.FetchRequestParams fetchParams, Collections.Generic.IEnumerator<ServerEntity> remoteReader, Collections.Generic.List<Guid> changedRecords, Collections.Generic.List<Guid> downloadedRecords, Boolean forceFullSync)
at SyncEngine.ClientBasedSyncTable(Data.db, Data.Synchronization.TableSyncAnchor anchor, Data.MetaEntity meta, Data.Synchronization.SyncFilter syncFilter, Collections.Generic.List<Guid>& changedActivities, Collections.Generic.List<Guid>& downloadedLists, Boolean forceFullSync)
at SyncEngine.SyncEntities(Data.db, Data.Synchronization.Anchor syncAnchor, Collections.Generic.List<SyncEngine.SyncAnalyzer.ExtendedMetaData> entityList, Data.Synchronization.SyncFilter syncFilter, Int32 progressMax, Collections.Generic.HashSet<String> toDeleteEntities, Collections.Generic.List<Guid>& lists)
at SyncEngine.DoExecute(Data.db)
at SyncEngine.Execute(Data.db, Boolean isHighEndDevice, Data.Synchronization.SyncResult& result)
at SyncEngine.Execute(Data.db, config, Data.Synchronization.SyncResult& result, Func<String[],Int32,Boolean> progress, Data.Synchronization.SyncConflict conflictCallback, Boolean isHighEndDevice, Boolean isRequestedByUser, Func<String> getNetworkDetails, Boolean isRestartSync)
</EXCEPTION>


<Details>

<UploadSync> Entitys=234ms Sent=1 SvrCalls=1 TotalTim=234</UploadSync>
Sleep=1000ms
Upload:NoChangesLeft

<IncSync>
<SyncDeletes <Analyze Tim=141ms NoSvrChanges/> />
<Downloader CacheSize=250MB UsedCache=48MB/>

Recv=40320 TotalTim=75219
</IncSync>
</Details>

<Summary>
<Settings Server='5;Crm2011.13/OnlineFederation2016' Threads='3' MaxExecMultiple='100' NOLOCK='true' Foreground='false' Launch='Manual'/>
<Results Sent='1' Recv='40320' Result='Normal'/>
<Times Total='77234ms' Prepare='406ms' UploadTotal='1594ms'/>
<Exception>2022-01-06T15:28:24.8322882-05:00: SqliteException: Abort due to constraint violation
UNIQUE constraint failed: incident.incidentid
</Exception>
<UploadSync Entitys='234ms' Sent='1' SvrCalls='1' AllChangesUploaded='true' SleepTime='1000ms' UploadTime='234ms' TotalTime='1234ms' />
<DownloadCustomization Status='NotModified' License='Valid' TotalDownloadTime='406ms' />

<IncSync Recv='40320' TotalTime='75219ms'>
<SyncDeletes AnalyzeTime='141ms' NoSvrChanges='true'/>
<SyncDownloader CacheSize='250MB' UsedCache='48MB'/>
</IncSync>

<FatalError>Abort due to constraint violation
UNIQUE constraint failed: incident.incidentid</FatalError>
</Summary>

Please reply if you have faced this same issue and found solution of it.

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    Hi aakash chaudhari,

    According to the error message, there is a sync conflict with the case entity(incidentid is duplicated).

    Please refer to this doc to deal with it:

    Configure offline data for the Field Service (Dynamics 365) mobile app (contains video) | Microsoft Docs

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 75 Super User 2025 Season 2

#2
Siv Sagar Profile Picture

Siv Sagar 52 Super User 2025 Season 2

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 42 Most Valuable Professional

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans