This article describes setting up the Salesforce Server instance for use with the Javascript Apply Form.
This documentation is designed for people familiar with Javascript programming 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 version 7+ of the resource manager.
Pages
The Javascript Apply Form makes use of pages on the public site for generating Json containing language dependent data, and for the File-uploads. Submitting the data is handle via a rest controller. Because of 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
As well as the following controller:
3) cxsApplyFormRestController
Click on Setup->Develop->Sites. Click on the Site Label. Add page 1) and 2) to the Site Visualforce Pages.
For adding 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.
Click on 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".
Comments