I have created a new custom VF Page for AccountContactRelation object for creating a new record that's because of Custom Lookup dialog for Contact. But i am unable to override the Standard AccountContactRelation page as there is no New button under the “Button, links & Actions” section where we can override the Visualforce page for New button.

enter image description here

  • One option could be remove the related list and add page as inline. – Raul Mar 23 '17 at 6:06
  • From where do we need to remove the related list are you referring to related list on Account Page? – RCS Mar 23 '17 at 6:10

AccountContactRelation (ACR for short) is a 'special' SObject, by which I mean that Salesforce appears to have implemented it in a way that it doesn't have the the complete 'standard' set of customizations that we can apply to an SObject.

You're correct in saying that to completely override a standard action (like creating a new record), we'd need to go to the object's Buttons, Links, and Actions, and override there. As you've noted, there are no Buttons, Links, or Actions defined on ACR (at least, none that we can see).

The closest that you'll be able to get to overriding the 'New' page for ACR is to do the following:

  • Create a new List button for ACR, and point it to your Visualforce page
  • Go to Account and Contact layouts
  • Edit the ACR related list in each layout to remove the 'New Relationship' button
  • Add your custom List button to the related list

This won't prevent people who can url-hack from seeing the standard 'new ACR' page (/<ACR Id prefix>/e still goes to the standard page), but it should ensure that the vast majority of your users use the page you intend.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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