Insert parent and child records using 1 table

Jesus GonzalezJesus Gonzalez ✭✭✭
edited June 25, 2020 in Questions
Hello!

I have a table in a Ui-Only model that contains information of 2 different objects that I need to insert and which are parent and child.

Would it be possible to use a row action to create the 2 records considering that we need to retrieve the Id of the newly created parent record before inserting the child one and that the parent record might be different in each row?

Many thanks!
Jesus

Comments

  • Pat VachonPat Vachon 💎💎💎
    edited June 25, 2020
    It's possible for sure using javascript. Might even be able to do it using only action framework. Your scenario needs more explanation though.
  • Jesus GonzalezJesus Gonzalez ✭✭✭
    edited October 30, 2019
    My preference would be to use only action framework if possible.

    The table below shows the scenario I described. The idea would be to create the Enterprise records 'Enterprise 1', 'Enterprise 2' and 'Enterprise 3' and the Year records related to each enterprise (for example 2017 and 2018 for Enterprise 1).

    Since we have multiple parents in the same table, I wondered how to retrieve the right Id to use it when creating the child records.

    image

    Thanks!

  • Pat VachonPat Vachon 💎💎💎
    edited November 4, 2019
    So Enterprise__c is the parent record for Year__c? If yes, then for sure javascript.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!