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.) - Charlie
답변 9개

Hi Charlie,You should be able to take working code from production and test in a sandbox by changing two things (possibly three).1. Sandbox org ID - sounds like you have already checked this2. The submitted URL is different for sandboxes. It should be as follows: <form action="https://test.salesforce.com/servlet/servlet.WebToCase? encoding=UTF-8" method="POST">3. And the possible third thing to check is custom field IDs - I'm not sure if you have checked this or not. You do say that all the custom fields exist in the sandbox, but if they were created independently from the ones in production (i.e. they were created in the sandbox after the sandbox was created or refreshed). then they will have a different ID and you will need to update that in the code.Thanks,Nagendra.