You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rescocrm edited this page Aug 2, 2024
·
3 revisions
Binds or unbinds the handler for further actions on saved route.
Bound handler is called with the RoutePlan object as an argument.
Use suspendPostSave method to suspend the post-save process if an asynchronous operation is required.
Arguments
Argument
Type
Description
handler
function(RoutePlan)
The handler function that has to be bound or unbound.
bind
Boolean
Determines whether to bind or unbind the handler.
scope
Object
The scope for handler calls.
This example demonstrates how to initiate the background synchronization if saved route contained a new visit ("Sync Login" option has to be turned off and "Save Password" turned on in Woodford configuration).
varsyncNeeded=false;MobileCRM.UI.RoutePlan.onSave(function(routePlan){if(!syncNeeded){// Check if some of route entities isn't newsyncNeeded=routePlan.myRoute.some(function(e){returne.isNew;});}},true);MobileCRM.UI.RoutePlan.onPostSave(function(routePlan){if(syncNeeded){syncNeeded=false;MobileCRM.Application.synchronize(true);// new item was saved - force background sync}},true);