Developer forum

Forum » CMS - Standard features » Trigger save on all users

Trigger save on all users

Siv-Renate Hansen
Siv-Renate Hansen
Reply

We use the map module in dw 9.7 no rapido, and get our users through an integration. The geo long/lat is saved in the user, but when the user is imported these fields are not set, and the only way I've found to trigger update on ACCESSUSERGEOLOCATIONLAT and ACCESSUSERGEOLOCATIONLNG is by opening and saving the users one by one. Very time consuming! Is there another way I can trigger an update


Replies

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply
This post has been marked as an answer

Hi Siv,

 

Yes... Go to Settings > Control Panel > Maps

https://www.screencast.com/t/3MyV4cPTjas

 

Choose a user group and click "Update". You may need the proper Google Maps credentials and remember they now charge after a few thousand request per month.

 

Best Regards,

Nuno Aguiar

Votes for this answer: 2
 
Roald Haahr
Reply

Hi,

I was just facing the same problem, and this solved the problem. However, I assume that this have to be done manually each time new users are imported. Is there a way to update geolocations programmatically on a site running DW 9.8.10?

Kind regards,
Roald, Novicell

 
Nicolai Pedersen
Reply

Dynamicweb.Security.SystemTools.Maps:

Use GetLocation to return a location object with lat and long. It takes an address as parameter: string.Format("{0} {1} {2} {3} {4}", user.Address, user.Address2, user.Zip, user.City, user.Country).Trim();

Use SetGeolocationFromGoogleMaps to set lat and long on a user or group object.

Requires that you have the maps module (all current licenses should have that) and that you have configured maps with an API key, see docs. Be aware of Google maps api quotas.

BR Nicolai

 

You must be logged in to post in the forum