So I'm currently trying to populate the "TO" address which should be a custom object's(Partner) Email

Here's what I tried -


rtype - a0U/o (Partner object home page)

Error I receive -

Unable to Access Page The value of the "p2_lkid" 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.

What am I doing wrong ? Here's a snapshot of where I want to populate the email field from Partner enter image description here

  • Are you sure you are not misspelling Opportunity.PartnerId__c? Maybe it should be Opportunity.Partner__c.Id. – smukov Oct 20 '15 at 18:17
  • I used the merge field generated from the custom button. So it should be correct. But I'm not sure if populating Partner Id will fetch me the Partner's Email field. – Sanjay Oct 20 '15 at 18:38

So I've done some tests on my end and this is what I found out:

  1. If you manually click on lookup icon next to the To field you'll see that Salesforce lists only Contacts. This means that p2_lkid can only contain ID of a Contact record, and if that ID is of any other object type you'll get the exact same error you are getting. So check that Opportunity.PartnerId__c returns an ID to the actual record.

  2. Next, when you get the Unable to Access Page error, if you are inside Chrome press F12 and look at Console outputs. There should be a 500 (Server Error) with a link that your custom button tried to open - you can use this to debug if the ID and other parameters were correctly populated.

500 (Server Error)

  1. I believe that you'll have to use the {!URLENCODE} function for the rtype part of your string as the / character in a0U/o will break the URL and you'll get the same Unable to Access Page error for your rtype. So, format the rtype parameter like following - ..&rtype={!URLENCODE("a0U/o")}&..

  2. Finally, if I were you I'd start debugging the issue by using only p2_lkid parameter and omit the other two. So create a custom button with following URL (/_ui/core/email/author/EmailAuthor?p2_lkid={!Opportunity.PartnerId__c}) and see if To field is populated correctly. If you make that work than you can move on to rtype and p3_lkid fields.

I hope that this answer can help you.

| improve this answer | |
  • Thanks smukov for the detailed explanation! sure I will give a try. – Sanjay Oct 21 '15 at 15:33

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.