This guide explains how to create offline records. We will create a form with two pages: the first to show the records and the second to create a new record.
First Page-
- Initial Setup:
- Drag and drop a âJavaScriptâ, and a âSalesforce Lookupâ field onto your form.
- Rename the fields as needed.
- Drag and drop a âTextâ, and an âEmailâ field inside a âRepeatâ field onto your form.
- Rename the fields as needed.
- Drag and drop a âNavigationâ field onto your form.
- Rename the field as needed.
- Configuring The âJavaScriptâ Field:
- Click the pencil icon of the âJavaScriptâ field.
- Paste the code.
- Please use this code.
- Here,
3266-d503-ca72
is the field ID of the âTextâ field on the second page named âFirst Nameâ.
if( formyoula.form_fields['3266-d503-ca72'].get('value') ){
formyoula.form_fields['Record Lookup'].trigger('change');
}
- Configuring The âSalesforce Lookupâ Field:
- Click the pencil icon of the âSalesforce Lookupâ field.
- Set âObjectâ and âDisplay Additional Fieldsâ as shown below.
- Add a label for the âDelete Value Buttonâ as shown below.
- Configuring The âRepeatâ Field:
- Click the pencil icon of the âRepeatâ field.
- Click âSalesforce Pre-Fillâ.
- Set âObjectâ, âFormyoula Parent Fieldâ, and âSalesforce Parent Fieldâ.
- Select a connection for âAutofill Connectionâ.
- Note: We will create a Salesforce connection in Step -10.
- Configuring The âNavigationâ Field:
- Click the pencil icon of the âNavigationâ field.
- Set âButton Actionâ as âNextâ.
Second Page -
- Initial Setup:
- Drag and drop two âTextâ, an âEmailâ, a âField Update Buttonâ, a âSalesforce Offline Record Updateâ, and a âNavigationâ field onto your form.
- Rename the fields as needed.
- Configuring The âField Update Buttonâ Field:
- Click the pencil icon of the âField Update Buttonâ field.
- Set âField Updatesâ as shown below -
âSalesforce Offline Record Update || event || runâ
- Configuring The âSalesforce Offline Record Updateâ Field:
- Click the pencil icon of the âSalesforce Offline Record Updateâ field.
- Set âSelect Salesforce Fieldâ and enable the âCreate Offline Recordâ option as shown below.
- Add the âField Mapping JSON Dataâ.
- Please use this code.
- Please update the field IDs as per your Form.
{
"attributes": {
"type": "Contact"
},
"FirstName": "{{3266-d503-ca72}}",
"LastName": "{{3248-de34-e281}}",
"Email": "{{2620-b781-3340}}",
"AccountId": "{{b67b-1f26-7d62}}"
}
- Configuring The âNavigationâ Field:
- Click the pencil icon of the âNavigationâ field.
- Set âButton Actionâ as âBackâ.
- Save the changes.
10. Creating The Salesforce Connection:
- Create a Salesforce Connection to prefill the Repeat field.
- Note: Please check out this guide to create Salesforce Connection in detail: https://guides.formyoula.com/public-guides/creating-form-connections
- Here, we are mapping the form fields inside the repeat field with the Object field.
- Configuring The Form Setup:
- Click âSetupâ on the form edit page.
- Enable Auto-Repeat.
- Disable Standard Navigation.
- Save the changes.
- Test Your Form:
- Search for an Account.
- It will prefill the related contacts.
- Click the Navigation button âAdd Recordsâ.
- Clicking on this will direct the user to the second page.
- Fill in the data to create records.
- Click the âField Update Buttonâ to create records.
- Click the âBackâ button.
- It will prefill the record to the repeat group.
Example Form:
Create Record Offline [Example Form].json14.5KB
For any questions, please contact us - [email protected] or the Formyoula in-app chat. đ