2

The requirement is to extend the Campaign page with a custom picklist field that shows data (select options) stored in a 3rd party system (accessible trough a rest endpoint).

I know there is the possibility to include a custom visualforce page in the page layout. But there are some limitations like the inlined visualforce page can't be used in the edit mode of the standard page. This is a bit cumbersome and will also end up in an unfamiliar editing experience for the user.

What is the best/natural way to accomplish this?

Here are some (maybe strange) thoughts/hacks that i can image to get this working:

  1. Only override the getter method for the picklist options value from the standard controller (combination of controller extension + apex:detail page)?
  2. Add some custom java script that override the options in html?

This is the first time i use visualforce, so any recommendations and pointers to right direction are really welcome.

1
  1. is not an option as far as I know. You can't override that

  2. can be done, e.g. with some parts of this code https://developer.salesforce.com/forums?id=906F00000008kzBIAQ but then use your rest service as the data source. But it is seen as a hack, obviously, and requires you to include the Messages&Alerts on each page.

  3. The solution prescribed by SF will be to create a VF page from scratch to override the standard Edit page. You will lose the standard page layout assignment, though.

Ideally, there should be an apex:detail component that allows edit mode, so you can put your javascript there, but unfortunately that's not supported (vote here: https://success.salesforce.com/ideaview?id=08730000000BrQtAAK)

  • I hoped that a 'default solution' for this kind of functionality exists (without create visual page(s) from scratch). Anyways thanks for your input, but i think i will go another route and pushing the needed data from the external system to salesforce and using a custom object + campaign lookup field. Another idea that would help to solve such scenarios Add a Visualforce Page/Component inline on "Edit" page – lgraf Mar 20 '14 at 13:27

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.