1

I am trying to prepopulate some fields while creating a new record. It was a easy fix with classic with the url hack.

Now with lightning experience this doesnt work. Looking at this Quick Action on related list We need to use actions. But cant see how we can add actions to Related List?

One of the answers mentions that you can override the new button but i think its overriding on the top level and not the related list.

Can prepopulating of fields possible from related list level even possible?

1 Answer 1

0

As for your original question:

Can prepopulating of fields possible from related list level even possible?

The answer is Yes. And it can be done the way you have mentioned by overriding the New button (and using a custom lightning component). The override is always applicable on the object you implement and not on the object it is related to.

So let's say if you override the new button on say object A, and that it is related to say object B, then when in object B's detail page, and in related list for object A, the new button on related list for object A will always be applicable on object A and not on object B.

Now how you can pre-populate the fields on any object? You can do so by utilizing the defaultFieldValues parameter of force:createRecord. However remember as in its current form, you cannot pre-populate values from the parent record, i.e., in the above example, when you click on New on related list A, you cannot populate values from object B on any of the fields on object A. You can find more about this here on this idea.

2
  • Thanks, Not sure if its worth the effort to create a custom lightning component. So if i am understanding this correctly- I cannot have field values in opportunity prepopulated with values from Account?
    – Prady
    Jun 6, 2018 at 17:26
  • Well, if you want to achieve what you need then definitely its worth having a custom LC. As for your question - yes, if on opportunity, you cannot have values from account pre-populated.
    – Jayant Das
    Jun 7, 2018 at 1:39

You must log in to answer this question.

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