Skip to content

MobileCRM.UI.EntityForm.updateAddressFields

rescocrm edited this page May 15, 2023 · 9 revisions

Sets the address fields according to the current geo-location from platform-specific location service.

Arguments

Argument Type Description
latitude Number The latitude from geo-location from platform-specific location service
longitude Number longitude from geo-location from platform-specific location service

This example demonstrates how to obtain MobileCRM.UI.EntityForm object. Then use the MobileCRM.Platform and getLocation method to receive latitude and longitude what update the address fields.

MobileCRM.Platform.getLocation(function (res) {
	if (res.latitude && res.longitude) {
		MobileCRM.UI.EntityForm.requestObject(function (entityForm) {
			entityForm.updateAddressFields(res.latitude, res.longitude);
		}, MobileCRM.bridge.alert);
	}
}, MobileCRM.bridge.alert);
Clone this wiki locally