I created a custom button "Add" and put in on the related list. But I need some help figuring out how to give it the same functionality of "New" when clicked

enter image description here

  • 2
    What does it do now? – sfdcfox Apr 13 '18 at 14:55
  • "Add" has no functionality now, I hoping to have it open up a New Record modal – Jimmy VA Apr 13 '18 at 14:58

You'll want to create a quick action for this. Here is the documentation. If you want you can even go so far as to add some level of automation to your quick action using a macro.

Normally I would copy the text from the page over but it's a length page.

If you can't accomplish what you need with the quick action you'll need a lightning component which is much more complicated. You can use Trailhead to learn more about quick actions and lightning components as well.

  • I looked into Quick Actions, though it looks like it needs to be in the form of a button so that it can be displayed on a related list – Jimmy VA Apr 13 '18 at 15:17
  • I posted another answer that you can use for those types of buttons. I'm not removing this one as it's still useful to other users. – gNerb Apr 13 '18 at 15:34

My other answer, while useful, was base don misunderstanding of the question so I'm posting another answer.

To accomplish what you want you can use a URL hack. Go to the new page for the object you're trying to create and copy the URL, then use that URL as the location for your button.

This is a great article for URL hacks.

  • 1
    URL hacks are, well, hacks, and they have a tendency to break when Salesforce makes significant changes to its URL structure. Example: Lightning Experience. The question asked here involves LEX, so I don't think that the cited URL hacks will work here. – DavidSchach Apr 13 '18 at 23:48
  • I completely agree on hacks, only posted cause I was thinking in classic. You're probably right that URL hacks likely don't work in LEX but this answer could still help a user who stumbles onto the question that doesn't use LEX so I'll leave it up. – gNerb Apr 16 '18 at 15:02

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.