0

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
  • 2
    What does it do now?
    – sfdcfox
    Commented Apr 13, 2018 at 14:55
  • "Add" has no functionality now, I hoping to have it open up a New Record modal
    – James VA
    Commented Apr 13, 2018 at 14:58

2 Answers 2

1

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.

2
  • 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
    – James VA
    Commented Apr 13, 2018 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
    Commented Apr 13, 2018 at 15:34
0

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.

2
  • 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. Commented Apr 13, 2018 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
    Commented Apr 16, 2018 at 15:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .