Skip to main content
Jayesh Bhatnagar 님이 #Lightning Experience에 질문했습니다
I have a custom lightning component to create opportunities. This lightning component uses a lightning:recordEditForm and within it has a lightning:inputField lookup field. Everything is working fine. I am able to lookup an Account with the lightning:inputField lookup field and select a value and save the opportunity. My question is how do I default a value for the lightning:inputField lookup field? I am able to do this for the other text fields by specifying the value in my component. But there is no documentation for the lookup field defaulting. What is the format for this? Is it possible?
답변 6개
  1. 2018년 4월 29일 오전 12:39
    you might need to retrieve the id of the lookup from server side and not load recordEditForm until you get the value

    or 

    if you are using action from account to create opportunity with the account lookup, the value can be set from force:hasRecordId which will give you the recordId of the account.
0/9000