Create Offline Records

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-

  1. Initial Setup:
  • Drag and drop a “JavaScript”, and a “Salesforce Lookup” field onto your form.
  • Rename the fields as needed.
image
  • Drag and drop a “Text”, and an “Email” field inside a “Repeat” field onto your form.
  • Rename the fields as needed.
image
  • Drag and drop a “Navigation” field onto your form.
  • Rename the field as needed.
image
  1. Configuring The “JavaScript” Field:
  • Click the pencil icon of the “JavaScript” field.
  • Paste the code.
image
  • 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');
}
  1. Configuring The “Salesforce Lookup” Field:
  • Click the pencil icon of the “Salesforce Lookup” field.
  • Set “Object” and “Display Additional Fields” as shown below.
image
  • Add a label for the “Delete Value Button” as shown below.
image
  1. Configuring The “Repeat” Field:
  • Click the pencil icon of the “Repeat” field.
  • Click “Salesforce Pre-Fill”.
image
  • Set “Object”, “Formyoula Parent Field”, and “Salesforce Parent Field”.
image
  • Select a connection for “Autofill Connection”.
  • Note: We will create a Salesforce connection in Step -10.
image
  1. Configuring The “Navigation” Field:
  • Click the pencil icon of the “Navigation” field.
  • Set “Button Action” as “Next”.
image

Second Page -

  1. 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.
image
image
  1. 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’
image
  1. 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”.
image
  • 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}}"
}
  1. Configuring The “Navigation” Field:
  • Click the pencil icon of the “Navigation” field.
  • Set “Button Action” as “Back”.
  • Save the changes.
image

10. Creating The Salesforce Connection:

image
  • Here, we are mapping the form fields inside the repeat field with the Object field.
image
  1. Configuring The Form Setup:
  • Click “Setup” on the form edit page.
image
  • Enable Auto-Repeat.
  • Disable Standard Navigation.
  • Save the changes.
image
  1. 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.
image
  • Fill in the data to create records.
  • Click the “Field Update Button” to create records.
  • Click the “Back” button.
image
  • It will prefill the record to the repeat group.
image

Example Form:

Create Record Offline [Example Form].json14.5KB

For any questions, please contact us - [email protected] or the Formyoula in-app chat. 🙂