Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Unanswered

Xrm.WebApi.offline - contains operator is not working in filter condition

Posted on by 30

Hi all,

i'm trying to use the Xrm.WebApi.offline API in Dynamics 365 to perform the RetriveMultiple operation in offline mode when using the mobile app without internet connection.

When I am running below code in offline, facing error "This Operation failed because your're offline. Reconnect and try again later

Xrm.WebApi.offline.retrieveMultipleRecords("new_tree", "?$select=new_treename&$filter=new_parenttree eq 724a2315-7dfe-ea11-a815-000d3a35b35b and contains(new_assetname, 'fire')")

But when I am running below code without 'contains' operator then it is working.

Xrm.WebApi.offline.retrieveMultipleRecords("new_tree", "?$select=new_treename&$filter=new_parenttree eq 724a2315-7dfe-ea11-a815-000d3a35b35b")

I have tried with 'Like' also, but it is not working.

Can anyone suggest, what exactly we can do here to query with 'contains' operator, 

  • Ankit S Profile Picture
    Ankit S 30 on at
    RE: Xrm.WebApi.offline - contains operator is not working in filter condition

    Hi Leo,

    Thanks for reply.

    We have set up mobile offline profile and while doing testing in mobile we always do profile synchronization.

    For comparison we have values to compare hence we are sure that we are not comparing will null.

    As per suggested URL, It is for Retrieve or filter lookup properties, that we are taking care of it.

    But our concern is regarding 'contains' operator, it is working when we go online in mobile but when we go offline then it is giving error.  "This Operation failed because your're offline. Reconnect and try again later"

  • LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: Xrm.WebApi.offline - contains operator is not working in filter condition

    Hi Partner,

    First please make sure that you've set up the mobile offline synchronization first.

    And in the Doc, comparing with null is also not supported. So some operators may not be supported in offline mode.

    pastedimage1601450404554v1.png

    https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/xrm-webapi/retrievemultiplerecords#retrieve-or-filter-by-lookup-properties

    If the issue still exists, please raise a ticket to Microsoft to check if it is by design or need other configurations.

    Regards,

    Leo

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,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans