Skip to content

MobileCRM.UI.RoutePlan.onItemAdded

rescocrm edited this page May 15, 2023 · 2 revisions

Binds or unbinds the handler for "Item Added" event.

Bound handler is called with the RoutePlan object as an argument.

The RoutePlan context object contains property "entity" carrying DynamicEntity object of the new visit record.

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 modify new appointment when being included into the route.

MobileCRM.UI.RoutePlan.onItemAdded(function (routePlan) {
	var newAppointment = routePlan.context.entity;
	newAppointment.properties.description = "Added from RoutePlan";
}, true);
Clone this wiki locally