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 :
Microsoft Dynamics CRM (Archived)

Resco Mobile offline HTML (Field Service ) - online/ offline issues on delete and update of entities

(0) ShareShare
ReportReport
Posted on by 67

Hi everyone. I'm developing a project using Resco Mobile Offline HTML and I got some different problems when the app is online or offline.

When it's "online":

OnlineResco.png

I can create and delete entities using my HTML but I can't update them. I got stuck for hours trying to update a field before I figure out that the problem occurs only when I'm online. Ex.:

I have this account:

CRMBefore.png

Then i changed its "Account type" from "Fornitore" to "Gruppo" and saved

             Before                                        After

2570.Before.png        6303.After.png

If i search at CRM it will remain as "Fornitore"

CRMAfter.png

and if i reopen my record:

AfterOnList.png  EntityReopened.png

So, after click on "Save" the value doesn't change on CRM or on my App. Only if I go offline, update (on this point it's already updated on my cellphone) and then Synchronize (to send it to CRM):

AfterSavedOffline.png  SavedOffline.png  OnSync.png

On CRM

CRMAfterSyncAndOfflineUpdate.png

  The JS method used to update

//JSBridge.js Version: 10.1
function update() { MobileCRM.DynamicEntity.loadById( 'account', window.location.search.substring(1), //accountid function (entity) { var plab_postalcode = document.getElementById('plab_postalcode').getAttribute("data-id");
...
entity.properties.plab_revenuerating = document.getElementById("plab_revenuerating").value; // For optionset and text if (plab_postalcode != '' && plab_postalcode !== null) entity.properties['plab_postalcode'] = new MobileCRM.Reference('systemuser', plab_postalcode); //for lookups entity.save(error_callback) }, function (error) { MobileCRM.bridge.alert('An error occurred: ' + error); } ); }

function error_callback(err) {
    if (err !== null)
        MobileCRM.bridge.alert('error: ' + err);
    else
        MobileCRM.bridge.alert('Account saved!');
}

When it's "offline":

OfflineResco.png

I can create and update entities but when I delete them on CRM, make the sync on Field Service App and open the entities list, it remains on my app.

Ex.: I created an account called "Feminho" and deleted on CRM. After that I made a sync

 Offline (entity remains)             Online (deleted)

AccToBeDeleted.png   AccToBeDeletedOnline.png

It's confusing since when I change to online those entities disappear and, if I change it back to offline those entities reappear... So, I have to delete those entities twice: once on CRM and once on Field service app.

Those are only some of the problems I'm heading with this new adventure. Thank you all

*This post is locked for comments

I have the same question (0)
  • Thomas David Dayman Profile Picture
    11,323 on at

    Hi Felipe,

    Could you possibly send us more screenshots of the issue. It sounds complex on paper but I might be able to understand it better.

  • Andreas Cieslik Profile Picture
    9,267 on at

    The Resco documentation for the save method as this parameter and description:

    forceMode

    Boolean

    [v10.0.2] Optional parameter which forces online/offline mode for saving. Set “true” to save entity online; “false” to save it offline. Any other value (including “undefined”) causes entity tobe saved in currently selected application offline/online mode.

    This should explain why it is only saved either online or offline.

    Also it is worth to read up on the JS Bridge guide:

    www.resco.net/.../JSBridge-Guide.pdf

  • Feminho Diniz Profile Picture
    67 on at

    I think that since I set no value it should "be saved in currently selected application offline/online mode." right? Anyway, I changed it now to "undefined" and got the same error. It must save offline/online

  • Feminho Diniz Profile Picture
    67 on at

    Check it now :)

  • Thomas David Dayman Profile Picture
    11,323 on at

    When you are in offline mode, it will only load data that's been saved locally on the tablet.

    But if you are in online mode, it will try and read the data on the server in real time.

    I wonder if its having conflicts on what data its seeing locally on the tablet and online. But even you said you were syncing the data in between each action, which is strange why it isn't working.

    Have you tried configuring these options? It might help you.

    5228.Screenshot_5F00_9.png

  • Feminho Diniz Profile Picture
    67 on at

    Yes, i have tried :/

    When I'm online the data doesn't even change on my app.

    The delete problem is strange too since I have set "On Conflict: Server Wins". it should delete even on the app, isn't it?

  • Verified answer
    Thomas David Dayman Profile Picture
    11,323 on at

    Yes, I have tested just now. If you have deleted something on CRM and you are online mode on the App. It should get removed if you refresh the list on the app as its reading the live data there and then.

    But if you delete a record on CRM, it will still appear as a record while in offline mode on the App even during after a sync. I think its because the regular sync doesn't pick up deleted records. It might be worth only deactivating records instead of deleting them to get immediate changes on the tablet while in offline mode.

    I found this article - https://blog.resco.net/2015/01/20/the-little-known-secret-of-incremental-synchronization-what-to-do-if-your-organization-creates-hundreds-of-records-each-day/

    The situation is very different during an incremental synchronization (every subsequent sync after full). Only the changes – modified or newly created records since last synchronization – are queried on the server. Notice that the sync filter doesn’t play any role in the query; regardless of the sync filter definition, all changes are downloaded!

    Only afterwards, once all changed and newly created records are present locally, the records that DO NOT satisfy the sync filter are deleted. So it is true that after synchronization only the records which comply with sync filters are present in the local database (only the Orders that belong to the current user), but the process how this is achieved is different than you might expect.

     


    It might be worth looking at this article as well - https://blog.resco.net/2014/11/11/online_vs_offline/

     

  • Feminho Diniz Profile Picture
    67 on at

    Nice! So, the "Delete problem" is solved! Remains only the "update when online" :)

  • Thomas David Dayman Profile Picture
    11,323 on at

    Ill try and investigate the updates while online soon. Iv'e used Resco for over a year but its hard to know all these things :)

  • Feminho Diniz Profile Picture
    67 on at

    I guess I'll try Resco support tonight and if we don't get an answer here, I'll send it for you

    Thank you so much

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 > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans