You need to sign in to do that
Don't have an account?
MisbahTehseen Parathanalli 3
Can anybody help me with a lookup field in a form to create a record in lightning component?
Can anybody help me with a lookup field in a form to create a record in lightning component?
i am creating a record by taking input from a form using lightning which has one lookup to the user record, i want help with that field....help needed with the same field....
Thanks in advance
i am creating a record by taking input from a form using lightning which has one lookup to the user record, i want help with that field....help needed with the same field....
Thanks in advance
There are two ways to do it:-
1) Lightning data service , here's a link to it:-
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/data_service_save_record.htm
2) Lightning:recordEditForm
https://developer.salesforce.com/docs/component-library/bundle/lightning:inputField/documentation
Hope it helps, if it does mark it as solved.
Thanks
Thanks for replying .... i have created the form and also able to save a record, but my issue is lookup field to the user object. Do you know any solution for this.
Hi Misbah,
Are you using lightning:recordEditForm? If not, can you add code that you are using?
Do you have a field on that custom object which is lookup to user ? If yes, then you can use <lightning:inputField FieldName = "Field API Name"/> in lightning:recordEditForm
Thanks
Below code i am using inside lightning:layout tag
<lightning:input aura:id="itemform" label="First Name"
name="itemname"
type="input text"
value="{!v.newUser.First_Name__c}"/>
<lightning:input aura:id="itemform" label="Username"
name="itemname"
type="input text"
value="{!v.newUser.Username__c}"/>
name="itemname"
type="email"
value="{!v.newUser.Manager_Email__c}"/>
<lightning:input aura:id="itemform" label="Copy profile from"
name="itemname"
type="input text"
value="{!v.newUser.Model_User__c}"/>
name="itemname"
type="email"
value="{!v.newUser.Manager_Email__c}"/>
<lightning:input aura:id="itemform" label="Copy profile from"
name="itemname"
type="input text"
value="{!v.newUser.Model_User__c}"/>
what all attributes can be added into it?
thankyou
In <lightning:inputField FieldName = "FieldName API (e.g. User__c)" > and for more information you can see this link:-
https://developer.salesforce.com/docs/component-library/bundle/lightning:inputField
https://developer.salesforce.com/docs/component-library/bundle/lightning:inputField/specification
Hope it helps, if it does mark it as solved.
Thanks