Skip to main content

I am new to Salesforce.  Using the web to case html generator, I have been able to use the "id keys" (as in '00N1a0000088TuL') to identify and send to Salesforce my data values ... as in:  

postData.Append("00N1a0000088Tv4=" + HttpUtility.UrlEncode(reportDate.ToString("MM/dd/yyyy")) + "&");

This code works in production.  The problem is my organization (rightly so) wants to test in sandbox before deployment.  The working code fails in the sandbox environment, and it's not as simple as the id's don't match or the wrong orgid is being used in the Sandbox environment.

I have determined the issue has something to do with failing on custom fields, if I try to submit ANY custom field.

            string sPost = postData.ToString();

 

            sPost = HttpPost("https://www.salesforce.com/servlet/servlet.WebToCase?encoding=UTF-8", sPost);

 

The response I get back is simply: 

"The remote server returned an error: (400) Bad Request."

All of the Custom fields are in the Sandbox instance.  I don't have any clue what is different between a sandbox with and/or without partial data ,  and production.  As far as I can tell the custom fields/page layout for the case, etc... are all there and correct.

Thank you in advance for any suggestions to resolve this, or alternatively the methodology to decern the difference between Sandbox and Production at a level detailed enough to isolate what is different/missing.  (My company is concerned about running tools that expose their settings/data to the world.)

4 answers
  1. Apr 11, 2017, 1:35 AM
    What happens if you generate the code from the sandbox instead of from production?