Skip to main content

SOQL + Geolocation = Proximity Search


Well at last, there is something I am really cheerful to write about (there have been other things, but sometimes I was busy, other times it was not this exciting).

The other day, I was looking at a project requirement, wherein we need to filter certain records based on their proximity to a certain location. As per current features, you’ll have to pull all relevant records and then calculate the distance between the desired location and record’s location and then determine its proximity.
Now, with Summer ’12, SOQL has been equipped with two new powerful functions, which would help you in doing just the same, without even getting into nitty-gritty of proximity calculation.

GEOLOCATION is function added to convert a given Lattitude-Longitude to a gelolocation.

DISTANCE is function added to calculate distance between two geolocations.

Read more at http://blogs.developerforce.com/engineering/2012/06/new-geolocation-features-and-mobile-apps.html.

Comments

Popular posts from this blog

Lightning: Generate PDF from Lightning components with in-memory data

I'm sure as everyone is diving into lightning components development, they are getting acquainted with the nuances of the Lightning components framework. As well as, its current limitations. Being a new framework, this is bound to happen. Although we have our users still using salesforce classic, we have started using lightning components framework our primary development platform and Visualforce is considered primarily for rendering lightning components within Classic Service console.
Recently, while re-architecting a critical module, we encountered a problem wherein we needed to generate PDF from lightning components. Now, being Javascript intensive framework, it has limited room for such features (may be included in future roadmap). As of now, there is no native feature within the lightning framework to do so (at least I didn't find anything).

Common Scenario - Create Visualforce page to retrieve data and generate PDF For scenarios where the data exist within Salesforce, it…

Quick Tips: Salesforce default Images

Well, I'm sure a lot of you still rely on using out of the box salesforce images for displaying quick icons within formula fields or even using them within your Visualforce pages. Lately, I realized that a lot of earlier resources are no longer accessible, so I tried to quickly extract all images from Salesforce CSS files and provide a quick reference here.

Please note, I've referenced all images from SF servers directly, so if anything changes, the image should stop rendering here. As these images are completely controlled by Salesforce, and in case they change anything, it might lead to image not being accessible.

Image pathImage/img/func_icons/arrowright10.gif/img/google/gmail_M_icon.gif/img/func_icons/ispan12.gif/img/func_icons/schedReport34.gif/img/func_icons/util/dialogClose16.gif/img/func_icons/util/rescale11.gif/img/overlaypointer.gif/img/msg_icons/confirm16.png/img/msg_icons/confirm24.png/img/msg_icons/confirm32.png/img/msg_icons/securityconfirm48.gif/img/msg_icons/er…

Lightning: Generate PDF within Lightning Experience with Salesforce Data

Some time back I posted a solution to generate PDF from Lightning components using in-memory data.
Post url:http://www.vermanshul.com/2017/07/lightning-generate-pdf-from-lightning.html

It was developed for a specific scenario, wherein we need to generate PDF where:
User interface is Salesforce classicInitiated via Lightning ComponentData doesn't exist within Salesforce and is completely in-memory As complex and tricky this situation was, we did end up finding a stable and equally tricky solution.

However, I realize that there are still lack of solutions (or maybe my search skills are downgrading) to generate and automatically download PDF document from Lightning Experience, without using any lightning components, wherein data exists within Salesforce. You can use the earlier solution in that case, but it will be an overkill.

There are various solutions available to generate PDF from javascript. But, I still think the plain old method of converting HTML to PDF (via visualforce PDF g…