You need to sign in to do that
Don't have an account?
Javier CG
URL hack don´t pass parameters to create new record in lightning experience
I have to remove javascript buttons to adapt it to lightning experience (LE).
I have created a custom button to create a new record, and like the new record has to receive some values from the related one, I do it with url hack, as the js button did it.
The button run perfect in classic, sending the values to the new record, but in LE the create record page opens, but not shows none of the sended values from the related record.
There exists some form to do it?
I know I would should use a quick action to create the new record in LE, but in some cases I need to change the values passed in function of the values of the related record, and I don´t know if this is possible with quick actions (ex: the record type of the new record depends of the profile of the user who creates it).
I have created a custom button to create a new record, and like the new record has to receive some values from the related one, I do it with url hack, as the js button did it.
The button run perfect in classic, sending the values to the new record, but in LE the create record page opens, but not shows none of the sended values from the related record.
There exists some form to do it?
I know I would should use a quick action to create the new record in LE, but in some cases I need to change the values passed in function of the values of the related record, and I don´t know if this is possible with quick actions (ex: the record type of the new record depends of the profile of the user who creates it).
You can use the defaultFieldValues attribute of force:createRecord to populate the default values in record create form.
All Answers
You can use the defaultFieldValues attribute of force:createRecord to populate the default values in record create form.
But I don´t know where I must put apex code in a custom button.
Now I have a custom button with an URL content origin and I can´t find one origin content that let me put apex code inside.
I need to prepopulate the fields for the user, but I want that the user can change it if he wants.
With your solution I have seen that the fire method launch the layout to create a new event (I´m trying to create a new event record) with the default values that I choose, but I still having two problems:
- I need to put dynamic values depending on the values of the original record (the action executes from a lead object), and I can´t find the way to catch the original record values to work with them (ex: the record type of the new record depends of the profile of the user who creates it).
- The lightning component window shows over the create event layout too even if I don´t put nothing inside on it. There is any form to open only the create new event window?
Sorry if my questions are silly, but it is my first contact with lightning components, I have been all the morning searching by the web and I can´t get it yet.
Thank you for your help