function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mr SlingMr Sling 

Custom Case Button pre-populates fine, but "Invalid Parameter" error appears when Saving

We've created a Custom Case Button (URL) that's available from Case Related Lists on our Custom Product Details Page.  

/500/e?cas3={!CustomProduct__c.Customer_Account__c}&cas3_lkid={!CustomProduct__c.Customer_AccountId__c}&retURL=%2F{!CustomProduct__c.Customer_AccountId__c}

It's pre-populating the Contact Info into the Case just fine, but when we click Save the following error is displayed: 

 

Unable to Access Page
Invalid parameter value "Bob Jones" for parameter "cas3". 

Error: The value of the parameter specified above 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 re-submit. If the error still persists, please report it to our Customer Support team and provide the URL of the page you were requesting as well as any other related information. 
 
We use 'Person Accounts' in our implementation and I'm concerned that might be causing our issue here, but the fact that it pre-populates just fine makes me wonder.  Any other ideas of what might be going wrong here?  Thanks!
Best Answer chosen by Admin (Salesforce Developers) 
werewolfwerewolf
Yeah, what you're passing in for the lkid parameter doesn't look kosher.  Check the URL that gets generated when you click the button -- if one of those parameters appears empty then that's a sure sign that that's your problem.

All Answers

NBlasgenNBlasgen
I wonder if it's looking for a ID rather than the name.  It's an odd message.  Best of luck on it ... not really my area but I thought I'd at least comment that it could be looking for a different input.
WYamWYam

The AccountID field looks like a custom field. From the Invalid parameter, it looks like you're passing text as the ID. If you break apart the error:

 

1.) The parameter has a value that's not allowed. I would imagine this is some sort of special character that isn't able to be passed from one field to the next like the french "é" or some other strange value.

 

2.) THe value exceeds the max allowed length. If the field case3I1kid is only set to say 10 characters and the value passed by accountID__c is allowed to be 15, that could be causing the error as well.

 

Though I do agree, it is a rather strange error.

 

 

werewolfwerewolf
Yeah, what you're passing in for the lkid parameter doesn't look kosher.  Check the URL that gets generated when you click the button -- if one of those parameters appears empty then that's a sure sign that that's your problem.
This was selected as the best answer
Mr SlingMr Sling

Thanks Master Shake - Thanks Werewolf!

 

Using your guidance, along with this other related post, I took a deep breath and was able to correctly build that URL.

 

Re: Redirecting to a different page when a custom object is created 

 

It must have been another post I saw elsewhere which instructed folks to try the "cas3" field references (from viewing the HTML page source, instead of simply looking at the URL).  Also, yeah... the original field values I used were wrong and were borking things up even more.

 

Here's what worked: 

 

/500/e?CF00N40000001fxqY={!CustomProduct__c.Name}&CF00N40000001fxqY_lkid={!CustomProduct__c.Id}&def_account_id={!CustomProduct__c.Customer_AccountId__c}&retURL=/{!CustomProduct__c.Id}

You guys rock.  Thanks again...