2

Need is one custom button that does two jobs: 1) automatically sets a selected pick list value on a custom field on the Opp, saves, and then 2) fires a pre-selected email template, leaving it merged, and ready for sending.

For 1) I have - /{!Opportunity.Id}/e?00NJ0000001VKBy=Requested &save=1 &retURL={!Opportunity.Id}

For 2) I have - /_ui/core/email/author/EmailAuthor?rtype=003 &retURL=%2F{!Opportunity.Id} &p2_lkid=003G0000021Osnd &p3_lkid={!Opportunity.Id} &p5={!$User.Email} &template_id=00XG0000001sUal

Both of these work individually. How do I fire them sequentially from the one button? Is that not possible?

0

It seems like you are performing the job with URL. First URL is setting picklist "Request"..then save the Opp and redirect the user to send email URL. I don't see feasible solution for it because it's a save button and can't be overridden. Can't you have intermediate page in between to save the opp and redirect the user to send email. –

0

While it is possible, such code is difficult to implement correctly. It would be far easier to just use the API to update the record, then load the send mail page with the template merged.

To implement this, you'd have to build the URL as:

{!Opportunity.Id}/e?field=value&save=1&retURL=[URL encoded value to email page with template selected]. 

I'm on a mobile device, so I won't try to get it right, but I'd invite anyone who wants to try to update this answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.