Get Current Location from the Device in Dynamics 365

By | March 3, 2017

Introduction:

Dynamics 365 is a leap forward from previous versions in terms of features and improvements. Even the mobile and tablet app of Dynamics 365 is updated with useful features to get the most out of the Dynamics CRM platform.

Dynamics 365 Mobile and Tablet app now offers the ability to get the current user location from the device. This is really helpful to track the location of CRM users.

How the ability to get users location can be helpful for Managers?

It is important for Managers to keep a track of what his team is up to. Tracking users’ performance is one way to ensure that users are working on their assigned projects and keep a track of their progress. Sometimes it is important for a Manager to know the exact location of the user.

Let us see an example where we want to get the current user location in Dynamics 365 Mobile and Tablet app:

1. First we create a custom entity ‘User Location’, which will show the current user location (latitude & longitude), date and time.

2. Before getting the location of the current user from the device, we need to configure the settings on the device.

3. On the Dynamics 365 mobile and tablet app, navigate to Home->Settings as shown in the screenshot below;

Get Current Location from the Device in Dynamics 365

4. Now navigate to Settings->Device Integration Settings. Configure the setting to set ‘User Content and Location’ to ‘On’ and Click ‘OK’, as seen in the screenshot below;

Get Current Location from the Device in Dynamics 365

5. We will now create a button ‘Check In’ on the user ‘Home’ page as shown in the screenshot below;

Get Current Location from the Device in Dynamics 365

6. To get the current location on the click of the button, we have written the below mentioned script;

 7. The script mentioned above will create the “User Location” record, set the Latitude and Longitude.

Note: To get the current location’s latitude and longitude, the user needs to use the code mentioned below;

Xrm.Utility.getCurrentPosition().then(function (location) { dosomething},function (error) { dosomething })

 

Conclusion: 

By following the steps mentioned above, a Manager can easily get the current location of the user in Dynamics 365. This is helpful in situations where a Manager needs to reassign certain tasks based on the current location of the users to make the most out of his resources.

Now find customers within X miles of the route using Maplytics ~ try today!

Leave a Reply