This guide will explain how to delete a record without submitting the form, whether you're online or offline.
Setup for Offline Use:
- Initial Setup:
- Drag and drop a ”Salesforce Lookup” field onto your form.
- Rename the field as needed.
- Drag and drop two “Text”, an “Email”, a “Salesforce Offline Record Update”, and a “Field Update Button” field inside a “Repeat” field onto your form.
- Rename the fields as needed.
- Add a new page on your form.
- Drag and drop a ”Salesforce Lookup” field.
- Rename the field as needed.
- Configuring The “Salesforce Lookup” Field:
- Click the pencil icon of the “Salesforce Lookup” field.
- Set “Object” and “Display Additional Fields”.
- Configuring The “Salesforce Offline Record Update” Field:
- Click the pencil icon of the “Salesforce Offline Record Update” field.
- Add the “Select Salesforce Field” and “Record ID” options.
- Add the “Record Lookup” field (Second page) under the “Select Salesforce Field” option.
- Here,
23f1-724b-a30d
is the field ID of the Contact ID field.
- Paste the code for field mapping:
- Please use this example code:
{
"attributes": {
"type": "Contact"
},
"Name": "{{6691-f96b-52a4}}",
"Id": "{{23f1-724b-a30d}}",
"AccountId": "{{f540-b445-84e9}}"
}
- Please make sure to update the field IDs as per your form.
- Here,
6691-f96b-52a4
is the field ID of the Full Name (Text) field.23f1-724b-a30d
is the field ID of the Contact ID (Text) field.f540-b445-84e9
is the field ID of the Select Account (Lookup) field.
- Enable the “Delete Offline Record” option.
- Configuring The “Field Update Button” Field:
- Click the pencil icon of the “Field Update Button” field.
- We will use this button to trigger the “Salesforce Offline Record Update” field.
- Add “Field Updates”:
Salesforce Offline Record Update || event || run
- Configuring The “Salesforce Lookup” Field On Second Page:
- Click the pencil icon of the “Salesforce Lookup” field.
- Set “Object” and “Display Additional Fields”.
- Test Your Form:
- Find an account.
- It will display the related contacts.
- Expand a record.
- Click “Delete Record” and click the “Delete” button.
- It will delete the record.
- Then click “Next” to go to the next page.
- Search for that deleted contact.
- You will not be able to find that contact as it is deleted.
- Connection Setup(optional):
- You can set up a Salesforce connection if you want to delete the records from Salesforce.
- Please check out this guide - https://guides.formyoula.com/public-guides/connect-your-forms-with-salesforce-objects
Setup for Online Use
- Initial Setup:
- Drag and drop a “Salesforce Delete Record” field outside the Repeat field at the very bottom of the form.
- Rename the field as needed.
- Configuring The “Salesforce Delete Record ” Field:
- Click the pencil icon of the “Salesforce Delete Record ” field.
- Add “Salesforce Object Name”, “Salesforce Record ID”, and “Repeat Group For Entry Deletion” options.
- Here,
23f1-724b-a30d
is the field ID of the Contact ID (Text) field.
bb9c-93f8-189a
is the field ID of the Repeat field.
Note: In this example, we are using the Repeat prefill to prefill the related contacts in the Repeat group. Please check out this guide: https://guides.formyoula.com/public-guides/salesforce-child-record-auto-fill-using-repeat-groups
Example Form.json15.3KB
For any questions, please contact us - [email protected] or the Formyoula in-app chat. 🙂