You need to sign in to do that
Don't have an account?

Pre-fill a field in lightning component with value entered in salesforce
Helloo,
Can you help me to achieve this requirement ?
How can I pre-fill a field in a lightning form with value entered in salesforce (Account object)
<lightning:input name ="myField "value="{!v.account.myField}" />
Can you help me to achieve this requirement ?
How can I pre-fill a field in a lightning form with value entered in salesforce (Account object)
<lightning:input name ="myField "value="{!v.account.myField}" />
Here is the way
If you want to populate from the apex class .. call the apex class method on do Inti and set the value to attribute
You can provide default values for standard or custom object like below.
For account:
<aura:attribute name="account" type="Account" default="{'sobjectType':'Account', 'myField':'Account123'}"/>
You must provide sobjectType in default.
Here sobjectType is case sensitive. If you use sObjectType it will not work.
Then if you use below code you will get default value.
<lightning:input name ="myField "value="{!v.account.myField}" />
Custom object:
<aura:attribute name="cusobj" type="'customobject__c" default="{'sobjectType':'customobject__c', 'field1':'value1','field2':'value2'}"/>
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks.
Rambabu.