1

This is my situation: I'm triying to create an autocomplete function with javascript or jquery in the contact's page layout. The idea is to autocomplete the post code and state according to what suburb the users types in. This can be done calling an external API (in my case, the Australian postal office) to retrieve the location of a suburb.

My problem is that I've read different ways to achieve autocomplete functions in custom visualforce page but not in a standard layout. These are some examples of how to do it in standard pages:

https://jungleeforce.wordpress.com/2013/05/05/using-jquerys-autocomplete-in-salesforce-part-1/

https://jungleeforce.wordpress.com/2013/05/05/using-jquerys-autocomplete-in-salesforce-part-2/

http://www.jitendrazaa.com/blog/salesforce/ajax-based-autocomplete-component-in-salesforce-using-jquery-ui-and-json/

Does anyone know something about this? or is there a restriction from salesforce to execute javascript/jquery functions in a standard layout?

Thanks in advance for any help.

  • You won't be able to achieve this on edit page. However you can embed an inline VF page to display your autocomplete section on Detail page. – Salesforcesmarty Feb 2 '16 at 0:32
  • Thanks but this new inline VF page won't fill the values of the standard page? What I want is to autocomplete those fields of a contact for example. – MANUELAN00 Feb 2 '16 at 0:37
1

That's true. Inline VF page won't fill the values of the standard page.

What you can do is :

  1. Display the same field (To be autocompleted) in Inline VF page.
  2. Populate values based on your operation
  3. Add one button on VF page to save the process
  4. When user confirms, update the record and refresh the window URL.

Let me know if you need any further help.

You can also refer this blog for autocomplete. This is pretty good.

http://blogforce9.blogspot.com.au/2013/10/auto-complete-visualforce-component-v2.html

  • Thanks @Salesforcesmarty. The company needs this functionality in the standard page so I guess they need to review it or adopt your idea and modify the contact's page in order to allow this. But thanks a lot for your explanation, was what I was looking for...!!! – MANUELAN00 Feb 2 '16 at 3:09

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.