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

Announcements

No record found.

News and Announcements icon
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.

  • 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

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

#1
Travis South Profile Picture

Travis South 54

#2
11manish Profile Picture

11manish 37 Super User 2026 Season 2

#3
ParthPatel249 Profile Picture

ParthPatel249 33

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans