function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Phuc Nguyen 18Phuc Nguyen 18 

Best option for creating new record

I need some help with solving an issue where I wan tto improve the user experince.  Currently I have a quaick action that has no fields on teh page except for Name whcih is requirted.  I defaulted the vlaue to 'Leave Blank".  I do this because I have a custom controller that assigned the name and updated other fields.  How can I remove the need for the user to have to do anything.  Ideally they would click the new button and it would generate the record. ANy suggestions 
Best Answer chosen by Phuc Nguyen 18
ShirishaShirisha (Salesforce Developers) 
Hi Phuc,

Greetings!

You need to write the formula to provide value to the Name field without having to display the field on the page and we should have this code in the save() function.

Reference:https://salesforce.stackexchange.com/questions/303751/automatically-create-a-record-when-user-clicks-new-button

Please mark it as best answer if it helps you to fix the issue.

Thank you!

Regards,
Shirisha Pathuri
 

 

All Answers

ShirishaShirisha (Salesforce Developers) 
Hi Phuc,

Greetings!

You need to write the formula to provide value to the Name field without having to display the field on the page and we should have this code in the save() function.

Reference:https://salesforce.stackexchange.com/questions/303751/automatically-create-a-record-when-user-clicks-new-button

Please mark it as best answer if it helps you to fix the issue.

Thank you!

Regards,
Shirisha Pathuri
 

 
This was selected as the best answer
Phuc Nguyen 18Phuc Nguyen 18
Thank you for the reply Shirisha.  Wil this approach work if the button is for the child record?  So user is on the parent record and there is a button to create a child.  How do I get the parent Id?  pageref?