+ Start a Discussion
Richie DRichie D 

Error with Id in querystring

Fellow developers,

 

I am experiencing a strange error - perhaps someone has come across this before and knows a solution?

 

I have a VF page that takes a number of parameters from the url and creates various custom objects. One of the last tasks it has to do is insert a Lead. If an Id parameter (containing a string not related to a SFDC id) is present in the querystring I get the error:-

 

EXCEPTION_THROWN|[199,17]|System.DmlException: Insert failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, invalid parameter value: []

Line 199 inserts the Lead.

 

so /mypage?firstname=bob&lastname=smith&id=abc123    = BROKEN

but /mypage?firstname=bob&lastname=smith                         = OK

 

I don't use the id. I don't have a standard controller. Its just a standard constructor (public myPage(){...} ) and action dosomething() in the VF page tag.

 

The reason is that it is there in an external flash application and the client swears it used to work with the id parameter and it will continue to be being passed in.

 

(I did try doing the following in the constructor "apexpages.CurrentPage.getParameters().remove('id');" with no success.)

 

Any ideas??

 

Thanks,

Rich.

 

 

 

 

JA-DevJA-Dev

Can you post your VF page and the controller code?