You need to sign in to do that
Don't have an account?

Different behaviors of same REST service
I have following code in a REST service exposed through Force.com site
When I call this REST service from hurl.it, it works fine and creates case.
When I call this same REST service from different program, it fails. I get error Insert failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, invalid parameter value: []
Pleaes note that all the field values are hard coded, so there is no chance of 2 clients providing different data to REST service.
Any help highly appreciated.
Case c = new Case (AccountId = '0019E000002pKMCQA2', description='est mgsg', Origin='Phone', Status='New'); insert c;
When I call this REST service from hurl.it, it works fine and creates case.
When I call this same REST service from different program, it fails. I get error Insert failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, invalid parameter value: []
Pleaes note that all the field values are hard coded, so there is no chance of 2 clients providing different data to REST service.
Any help highly appreciated.
The problem was with HTTP request parameter named id. When in simulation, I removed that paramter, it worked just fine, and when I put that parameter back in, it would give error. But my HTTP request are coming from 3rd party, and I have no control to avoid id parameter in request. So, I updated my REST service code to remove that paramter from map first, and then do rest of the logic execution.
It seems to be a bug in Salesforce platform though.
All Answers
The problem was with HTTP request parameter named id. When in simulation, I removed that paramter, it worked just fine, and when I put that parameter back in, it would give error. But my HTTP request are coming from 3rd party, and I have no control to avoid id parameter in request. So, I updated my REST service code to remove that paramter from map first, and then do rest of the logic execution.
It seems to be a bug in Salesforce platform though.
Probably your external program doesn't set all the required parameters to call a salesforce WS.
Se this example:
http://www.albinsblog.com/2014/07/calling-salesforce-rest-based.html#.WEr9QdIrLIU
Sorry, I don't find the oficial salesforce documentation.
Regrets,
Marcilio
Also, I am nto getting any data from request, I am inserting record with hard coded values. And that's where all the confusion is.
I also realized that when I send request from hurl.it, it works sometime and does not work other times. The behavior is totally random. Though when I take off id parameter from hurl.it request then it works always. And sometimes, even when I keep id parameter, it does works.
So, totally baffling whats going on.