JavaScript Application Form API: Setup Salesforce Server Instance

Follow

This article describes setting up the Salesforce Server instance, to be used with the JavaScript Apply Form.

This documentation is designed for people familiar with JavaScript and object-oriented programming concepts. You should also be familiar with application forms from a user's point of view. There are many Javascript tutorials available on the web.

This API is available in Connexys version 7 and later.

Pages

The Javascript Apply Form uses pages on the public site for generating JSON containing language-dependent data and for file uploads. Submitting the data is handled via a rest controller. Because of the Cross-Domain-Site-scripting nature, Salesforce must be set up to trust the Javascript hosting domain.

The following pages must be marked for public use:

  1. cxsApplyFormJson
  2. cxsApplyFormDocument
  3. As well as the following controller: cxsApplyFormRestController

Go to Setup > Develop > Sites. Click on the Site Label. Add pages 1 and 2 to the Site Visualforce Pages.
To add controller 3, press the button "Public Access Settings" and add 3 to the Enabled Apex Class Access

Additionally, the hosting site must be secure and added to the allowed Salesforce CORS domains. Go to Setup > Security Controls > CORS, and add your secure site.

Release 8 and up: These same domains added to the salesforce CORS, must also be added to the application setting "Javascript Form Origin Domains" (Connexys Setup > Application settings > All settings > Application form).

For more information on configuring your secure site, read Javascript Application Form API: Basic Setup.

Labels

The javascript form has a few labels that are used specifically for this form, these can be overridden in Salesforce.

Client-side text labels

Javascript label code Salesforce Label
SUBMIT Apply
SKIP Skip
DAY Day
MONTH Month
YEAR jsUpload
UPLOAD Replace
REPLACE jsUpload
TKTIMEOUT CV_unrecognized
UPLOADFAIL apply_fileUploadError
REMOVE jsRemove
REMOVETEXT jsRemovefileText

Client-side Error labels

Javascript label code Salesforce Label
ERRORS validation_errors
REQUIRED required_field
NO_FILE File_not_found
INVALID invalid_field
POSITION_NOT_FOUND Position_not_found
EVENT_NOT_FOUND Event_not_found
APPLICATION_NOT_FOUND Application_not_found
TOOLONG value_too_long
INVALID_DATE invalid_date_field
INVALID_BIRTHDATE invalid_birthdate_field
INVALID_EMAIL invalid_email_field
INVALID_URL invalid_url_field
INVALID_NUMBER invalid_number_field
REQUIRED_PRIVACY required_privacy_statement

Special Labels

dateFormat Label used to set the date format per language
numberFormat Label used to set the number seperator per language

Other javascript apply form specific labels can be found in salesforce by filtering on the category "javascript apply form".

Powered by Zendesk