Web-to-X portal forms are a powerful feature for creating records in Salesforce from the web, but there are some scenarios where Salesforce will deny the creation of Web-to-X records.
Web-to-X forms are not transactional, so the end user is not notified of the pass/fail result. The actual Salesforce record is created asynchronously after the web form has been submitted, so results cannot be displayed within the scope of the HTTP request.
However, all Web-to-X transactions are logged in great detail and available in the Salesforce portal admin console audit log. To debug a Web-to-X post, log into the portal as an Administrator and view the audit log of Salesforce web service events. The description field will provide a detailed explanation if the post was not successful.
Common causes for a failed Web-to-X transaction include:
Missing required field
Objects with required Lookup relationships are currently not supported by Web-to-X. You can "hard code" a reference field and value in the forms designer by adding a "sfdc_" prefix to the Salesforce field name as the Question Code.
Example:
Code= "sfdc_CampaignID"
Value =
some Salesforce Campaign ID
Hidden = true
To ensure that a required field is not missing, use the "Required" checkbox in the forms designer and define an error message.
Invalid Format
Salesforce enforces strong typing of fields, so a Currency field cannot contain a string value. Use the REGEX pattern in the forms designer to enforce type patterns.
No connection
The portal will attempt to create Salesforce object for the web using the credentials provided in the Salesforce portal admin console. If the account is invalid or the password has expired, then the post will fail.
If Salesforce is down for maintenance, then Web-to-X submissions will fail. For portal apps requiring high availability or transactional record creation, it's recommended to use the portal "Store and Forward" pattern using ASP.NET web forms that create XOS objects (eXtensible Object Store) which are then asynchronously created in Salesforce once the system becomes available.