Location Based Activities - Lightning
The new summer’16 feature automatic geocode for the address helps to track your nearby prospects and clients but you can also able to create location-based activities for the account, lead or contact records. Let’s see how to create location-based activity records. In this, below example, I will use the account record geolocation to track my activity records.
As a first step, set up the geocode clean rules - https://developer.salesforce.com/blogs/developer-relations/2016/07/making-salesforce-data-location-aware.html?language=en Once you setup the rule then, geocodes are automatically added to existing accounts, contacts, and leads. New accounts, contacts, and leads get this information when they’re saved.
Next, I have created custom checkbox field in activity object called ‘Remind me at a Location’. Enable the checkbox field when creating the activity record. This is to identify which task I want to see based on the current geo-location so this activity record will use the Account billing address geolocation in our custom page.
Lightning component
Now let's create a lightning component to display the activity records based on the current location in the Salesforce1 mobile app or in the browser. The lightning component has two logics first to identify the current geolocation of the user and next display the account activity records which is nearby based on the current geo-location.
Getting current geolocation
When the page loads first the lightning controller will get the current geolocation of the user and assign it to the component attributes. Below the simple code to get the current geolocation in lightning components
Now we have the current geo-location of the user, using that geo information we can able to retrieve the account task records which is nearby 20 mi. The SOQL query to retrieve the task record is as follow
When the user opens the lightning page in the salesforce1 mobile or in the browser then it will display the only activity records which are nearby based on the account record geolocation.
You can deploy this component by clicking this below button
You can deploy this component by clicking this below button
Source code - https://github.com/Karanrajs/Location-Reminder
The article is really helpful, thank you for posting.
ReplyDeleteRegarding list view I have a Question that, is there any possible way to update the List view describe using httpReq or metadata api
This is the best post for developing my knowledge and Keep posting. Thank you for sharing with us...!
ReplyDeleteSpark Training in Chennai
Spark Training
Pega Training in Chennai
Primavera Training in Chennai
Unix Training in Chennai
Linux Training in Chennai
Social Media Marketing Courses in Chennai
Power BI Training in Chennai
Tableau Training in Chennai
Great experience for me by reading this blog. Nice Article.
ReplyDeleteEthical Hacking course in Chennai
Ethical Hacking Training in Chennai
Hacking course in Chennai
ccna course in Chennai
Salesforce Training in Chennai
AngularJS Training in Chennai
PHP Training in Chennai
Ethical Hacking course in Tambaram
Ethical Hacking course in Velachery
Ethical Hacking course in T Nagar
Great experience for me by reading this blog. Thank you for the wonderful article.
ReplyDeleteAngularjs Training institute in Chennai
Angular 4 Training in Chennai
angularjs training institute in bangalore
Angular Training in hyderabad
best angularjs training in bangalore
angular training in bangalore
Salesforce Training in Bangalore
Hadoop training in bangalore
angular course in bangalore
angularjs training in marathahalli
The concept you are saying is good. I was so happy after reading this article. Thank You so much for the good article.
ReplyDeleteLeadership Training in chennai
leadership training companies in chennai
leadership course in chennai
leadership in chennai
sales training in Chennai
sharepoint jobs in chennai
mvc chennai
inplant training in chennai
Good job in presenting the correct content with the clear explanation. The content looks real with valid information. Good Work
ReplyDeleteDot Net Training in Chennai | Dot Net Training in anna nagar | Dot Net Training in omr | Dot Net Training in porur | Dot Net Training in tambaram | Dot Net Training in velachery
Very Well, This is the best i have ever seen, you explain very well. Totally Impressive. VPS Hosting
ReplyDeleteUK VPS Hosting