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.