0

We have used below lines of code to create contact record from contact related list on account. Is it possible to prepopulate accountId in contact record form?

<aura:attribute name="newContact" type="Object"/>
<aura:attribute name="simpleNewContact" type="Object"/>
<aura:attribute name="newContactError" type="String"/>

<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>

<force:recordData aura:id="contactRecordCreator" 
                  layoutType="FULL"
                  targetRecord="{!v.newContact}"
                  targetFields="{!v.simpleNewContact}"
                  targetError="{!v.newContactError}" />

4
  • I am not sure if you can do it using force:recordData but you can try Lightning:RecordEditForm newstechnologystuff.wordpress.com/2018/10/06/… Dec 19, 2018 at 10:04
  • You cannot do it as of today. Take a look at this answer, if that helps.
    – Jayant Das
    Dec 19, 2018 at 13:32
  • Why you did not try with force:createrecord event if you are using a full layout. You can set the predefined values there. Dec 19, 2018 at 17:52
  • How can i get the accountId,Contactid from overriden New Case Button? Dec 19, 2018 at 18:10

0

You must log in to answer this question.

Browse other questions tagged .