Skip to main content

Notifications

Service | Customer Service, Contact Center, Fie...
Suggested answer

Mobile Offline - Web Api Offline Retrieve

Posted on by Microsoft Employee

Hi all, Im triyin to do a offline retrieve to update workorder estatus related to a parentworkorder, but the code does nothing:

Here a part of the code:

var data = {
							"startdate": date,
							"msdyn_systemstatus": 690970002
						};
Xrm.WebApi.offline.retrieveMultipleRecords("msdyn_workorder", "?$select=msdyn_workorderid&$filter=_msdyn_parentworkorder_value eq "   woid).then(

                function success(result)
                {
                        
                        alert(result.entities.length);
						for (var j = 0; j < result.entities.length; j  )
						{
							relatedwo = result.entities[j].msdyn_workorderid;
							
							Xrm.WebApi.offline.updateRecord("msdyn_workorder", relatedwo, data).then(

							function success(result2)
							{
								// perform operations on record update
                                
							},

							function (error)
							{
								console.log(error.message);
								// handle error conditions
							});
                         } 
                Context.data.save(true);  
                }

What a I need to do to fix it??

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Mobile Offline - Web Api Offline Retrieve

    Hello, we have configured mobile sync offline, the code works but not right, the recovery gives me 1612 records instead of 3, it is as if it does not respect the filter of the odata query

  • Suggested answer
    Nya Profile Picture
    Nya 29,056 on at
    RE: Mobile Offline - Web Api Offline Retrieve

    Hi,

    The official documentation about Xrm.WebApi.offline says that:

    When in the offline mode, these methods will work only for tables that are enabled for mobile offline synchronization and available in current user’s mobile offline profile.

     pastedimage1622439406301v1.png

    Please make sure that you have configured mobile offline synchronization for your mobile app. Here is the steps: Configure mobile offline synchronization | Microsoft Docs

     

    And there are also some checkpoints in the above screenshot – Important section, which also need to be checked.

     

    If this helped you, I'd appreciate it if you'd mark this as a Verified Answer, which may in turn help others as well.

    Best Regards,

    Nya

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans