+ Start a Discussion
Jaime BlalockJaime Blalock 

How to edit my custom button to work in Lightning?

Hello! I am working on preparing my org to roll over to Lightning and I have seven custom buttons I need to update. My custom buttons are showing in Lightning but not workin as they should. Typically these buttons open and an email in a new tab and gather information up into a template. Here's an example of one: 

/_ui/core/email/author/EmailAuthor?rtype=003&p3_lkid={!GIS_New_Account_Set_Up__c.Id}&retURL=%2F{!GIS_New_Account_Set_Up__c.Id}&p5={!$User.Email}&p24="smorgan@geninfo.com,rmercado@geninfo.com,amoore@geninfo.com,skeele@geninfo.com,scausey@geninfo.com,jdailey@geninfo.com,jsowell@geninfo.com,nprabhakaran@geninfo.com,cvodila@geninfo.com,implogging@geninfo.com,impcontract@geninfo.com&template_id=00X500000015TvQ

Could anyone tell me what I need to change? I've read a few resources and I think I need to create an action but it's not clicking for me. I do not see how I can have the same result which is clicking the action and an email popping up in a new window with all of the information needed from Salesforce (based on an email template I have in place), all the email addresses needed are populated in and all the sales person has to do is click send.

Thank you!
Best Answer chosen by Jaime Blalock
Shivdeep KumarShivdeep Kumar
Hi,
For custom object you can't create a send email quick action. So as per your requirement you can do it by two ways :-
1- Create VF page with action attribute which will call the apex controller method, where you can write your logic.
Note :- Its a workaround to do it.

2- Create a custom component to send an email like below link.
http://sfdcmonkey.com/2017/01/03/send-email-lightning-component/


Please let me know if this help.

Thanks
Shivdeep

All Answers

Shivdeep KumarShivdeep Kumar
Hi Jaime,
URL hacks are not supported in Lightning Experience. The best way to pre-populate fields in Lightning Experience is to use actions.
Suppose you are using the case object then go to: Setup -> Object Manager -> Case-> Buttons, Links, and Actions -> New Action. Next choose action type :- Send Email then set page layout and after saving the layout, you will see the predefined field values section. In that section you can set the default values whatever you want.

Please let me know if this help.

Thanks
Shivdeep
Jaime BlalockJaime Blalock
Hello! I am in the create an action section under my custom object and the drop down menu for Action Type does not contain Send Email, the options are: Create a Record, Log a Call, Custom Visualforce, Update a Record, Lightning Component and Flow. 

Should I choose Create a New Record then Object and Record Type Task??? If I do that I can see an email option under Standard Label Type but that does not see like it's going to be what I need.

Thank you!
 
Jaime BlalockJaime Blalock
I looked under create actions for cases and there is an option to send an email, why is this not an option on my custom objects? All seven of my custom buttons are associated with custom objects...what should I do?
Shivdeep KumarShivdeep Kumar
Hi,
For custom object you can't create a send email quick action. So as per your requirement you can do it by two ways :-
1- Create VF page with action attribute which will call the apex controller method, where you can write your logic.
Note :- Its a workaround to do it.

2- Create a custom component to send an email like below link.
http://sfdcmonkey.com/2017/01/03/send-email-lightning-component/


Please let me know if this help.

Thanks
Shivdeep
This was selected as the best answer
Jaime BlalockJaime Blalock
Thanks for the advice, unfortunately I have no experience with either option and after looking at the paged to create a VF page or component I think I will not be able to do this. :( Thank you for your help. I will still mark this as best answer.