Tuesday, April 7, 2015

Geolocation Custom Field In Salesforce

The geolocation custom field allows you to create a field that identifies a location by its latitude and longitude. You can then use the geolocation field with the DISTANCE and GEOLOCATION formula functions to calculate distances between locations.

I would like to show you how we can update Geolocation field in Salesforce. It's slightly different from other fields, see it below:

Object Name: MyObject
Field Name: Geolocation__c;

To update Geolocation__c use below steps:

MyObject myObj = new MyObject(id=oid);
//here lat is a string
myObj.Geolocation__latitude__s = Decimal.valueOf(lat);
//here lng is a string
                myObj.Geolocation__longitude__s = Decimal.valueOf(lng);
update myObj;

Thanks.

Monday, March 30, 2015

How to upgrade User License for community user?

Solution# Admin needs to follow below steps to do so:


  • Open user details page for the user you want to change the user license
  • Open the contact associated with that User
  • Select "Manage External User" drop down button on Contact detail page
  • Select "Disable Customer User"
  • Then again select "Enable Customer User" option.
  • It will redirect to user edit page wherein license field would be auto populated.


Hope this will help.