function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Developer_shaanDeveloper_shaan 

Overriding lookup icon

can we override a standard lookup icon in salesforce with Visual Force.

If Yes.. Please let me know the steps to acheive this.

 

Thanks

Shaan

bob_buzzardbob_buzzard

Yes you can do this.  

 

Assuming you go with a similar popup window to standard SalesForce, you'll need to pass it the HTML element id of the input field where the result should be stored from the main page.  Then when the user chooses a value, call some javascript to populate the input field with the chosen value and close the popup.  You'll probably need to populate a text input field with the object name and then a hidden input field with the object id - that's how I've done it anyway.

Developer_shaanDeveloper_shaan

Thanks for the reply.

But how can we assign a VF page for lookup functionality.

I am not that clear with your solution. can you elaborate in steps.

 

bob_buzzardbob_buzzard

Ah - you want to override the lookup icon on a standard page - I thought you wanted to override the lookup icon generated via an InputField on a VisualForce page.

 

You'd need to get some javascript into the page to override the onclick for the icon.  That is possible through an HTML area on the sidebar and static resource javascript files, but its not straightforward.

 

Can you give us a bit more information about why you are wanting to do this?

Developer_shaanDeveloper_shaan

On a standard page when clicked on Lokup icon instead of getting particular value , we want a list of values that needs to be populated.

For Ex: when clicked on account lookup icon in Contact only respective account names are displayed instaed , i want account name, description, oppurtunities related to accounts to be displayed and they need  to be populated  in  custom fields on a standard conatct page.

bob_buzzardbob_buzzard

You can customise the fields presented in the lookup popup, but that wouldn't pull any other information through.  That said, if you are just pulling the data through, could you not just use formula fields?

 

 

sales4cesales4ce

Was this problem ever solved?

I have something similar i need to get it done.

 

i have a case object and it looks up at the Account. (Also, pls Note that we have Person accounts enabled).

Also, i have a contact look up as well to the Case.

 

Now, i need to override the Standard Look up icon click, to provide a way to create person accounts as well from both Account and contact standard look ups.

 

So when ever user clicks on standard look up icon, it opens a pop up that has a search dialog and right beside we have a option to create a "New " record if you don't find one.

 

To put it simple i need to override that "New" button to create a Person Account.

Is this possible?Id so, can you pls let me know the steps.

 

Any help on this is highly appreciated.

 

Thanks,

sales4ce

JHo85JHo85

@sales4ce did you ever figure out a solution to your problem? I have the exact same requirement a javascript override on the Contact lookup from Case to create a Person Account. Have the VF page built just need to figure out a way to render it in place of the standard lookup dialogue!

 

Cheers

 

J