You need to sign in to do that
Don't have an account?
chandrashekar Jangiti
How we can pre-populate values while creating record in lightning component page...
Hi Code player's..
Iam new to Lightning and i have one query "How we can pre-populate values while creating record in lightning component page..." please help with some example codes...
Thanks,
Chandu
Iam new to Lightning and i have one query "How we can pre-populate values while creating record in lightning component page..." please help with some example codes...
Thanks,
Chandu
You can use force:createRecord
The defaultFieldValues attribute lets you prepopulate the create record form with default or calculated field values. Prepopulated values can accelerate data entry, improve data consistency, and otherwise make the process of creating a record easier. Specify default field values as name-value pairs in a JavaScript object.
Refer below linkl which has sample code for the same.
https://albasfdc.com/2018/03/19/creating-pre-populated-records-with-lightningrecordeditform/
Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.
Best Regards
Sandhya
Thanks for quick reply, And also majorly am looking Lookup fields like Account,Contact and Opportunity need to prepopulate so is this code helpfull for me?.
Thanks,
Chandu
please refer to the below links.
1. https://developer.salesforce.com/forums/?id=9060G000000UYc0QAG
2. http://writeforce.blogspot.com/2012/12/prepopulating-fields-using-URL-hacking.html
Let me know if it helps you.
Thank You,
Ajay Dubedi
Thanks for reply..but am looking for in lightning page..and that second link is not working it is showing blank page..
thanks,
Chandu
please use this: http://writeforce.blogspot.com/2012/12/prepopulating-fields-using-url-hacking.html
Thank You,
Ajay Dubedi
thanks for helping , but am expecting in lightning component...please do help with lightning component and controller(force:Createrecord)..but am not able to find exact in component so...
thanks,
Chandu
It is not working for me which you shared code link...Could you help me with possible ways with prepopulating values of Account,Contact and Opportunity..
Thanks,
Chandu