I’m looking to add functionality to the new and edit Task layouts (specific to Salesforce Mobile), so that when a user completes a task their current location is added to a custom geolocation field on the Task record.

I created a Lightning Component and Lightning-enabled Visualforce page that retrieve the location with javascript and HTML5’s navigator.geolocation.getCurrentPosition method and tested adding each to a standard layout, but neither work, as far as I can tell. The Lightning Component doesn’t show up in edit mode in Lightning Experience (or in any mode on the mobile app) and the Visualforce page is embedded in an iFrame, so there’s no way to update fields on the standard layout.

I’m slowly coming around to the idea of needing to override existing layouts, but before I go down that much longer path just want to make sure I’m not missing an obvious solution (or an obscure solution… basically any other possible solution…).

I realize this question is similar to the one asked here, so hopefully this is a bit more specific: is there any way to implement a component with javascript that can interact with elements on a standard page? Appreciate any advice!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.