1

I know there are a lot of posts on this topic, but I haven't come across one with this issue. The closest is this post which I'm hoping the OP answers my comment.

I'm trying to create a button on the Activity History of a custom object (Enrollment__c). I want the button to bring up the Send an Email screen, so I'm using:

/_ui/core/email/author/EmailAuthor?

I would also like the button to set the To and Related To fields, so I'm setting the p2_lkid and p3_lkid parameters; retURL as well because you need to:

p2_lkid={!Enrollment__c.LeadId__c}&p3_lkid={!Enrollment__c.Id}&retURL={!Enrollment__c.Id}

The full URL is:

/_ui/core/email/author/EmailAuthor?p2_lkid={!Enrollment__c.LeadId__c}&rtype=00Q&p3_lkid={!Enrollment__c.Id}&retURL={!Enrollment__c.Id}

which renders as:

https://cs7.salesforce.com/_ui/core/email/author/EmailAuthor?p2_lkid=00QM0000006isR1&p3_lkid=a1nM0000000c8YF&retURL=a1nM0000000c8YF

I don't believe there is an issue with the URL hack, but please let me know if you find anything.

The problem I'm getting is when the button is clicked I receive the following error:

Unable to Access Page The value of a parameter contains a character that is not allowed or the value exceeds the maximum allowed length. Remove the character from the parameter value or reduce the value length and resubmit. If the error still persists, report it to our Customer Support team. Provide the URL of the page you were requesting as well as any other related information.

I only receive this error when I use both parameters at the same time, and both parameters contain IDs. If I replace {!Enrollment__c.LeadId__c} with {!Enrollment__c.Lead__c}which is the true field name the ID is replaced with the full name of the lead and the page loads, but does not set the To value.

Any help would be appreciated.

1

This is the correct format of the send email URL:

/_ui/core/email/author/EmailAuthor?p2_lkid=<Account.Id>&rtype=003&p3_lkid=<Related To ID>&retURL=%2F<ID of Reference Object>

If this won't help you probably you have to create a custom send email VF page with custom lookup functionalities as posted here

Hope this will help you.

  • Very cool - thanks @Ruslan. Unfortunately, it doesn't seem like the URL posted will work as I don't have direct access to the Lead for p2 from the where the button will be located. That said, the code you wrote up in the related post seems like a possibility. Ultimately, we wanted this functionality as a Quick Action, so creating a visualforce page might not be a bad idea. Thanks. – zainogj May 21 '15 at 19:29
  • p2 must be an account id and it cannot be something else. It is being used for "To" lookup. – Ruslan Vekua May 21 '15 at 19:33
  • 1
    Thanks for clarifying that, I was going to ask if that was a requirement from your post. And I just realized that is the issue. That makes sense, if you look at a task with a To set to a Lead you cannot set the Related To. Related To only becomes available when you set To to a Contact/Person Account. Looks like I won't even be able to use the custom VF page as you suggested if we want to do this with Leads. Thanks for your help! – zainogj May 21 '15 at 19:38

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.