This guide will explain how to open a new form using the Salesforce Table button.
We will create two forms, the first with a clickable table button and the second to launch a form with a pre-filled record ID.
The First Form -
It will show the Opportunities on the Salesforce table, and a clickable button will launch the second form.
- Initial Setup:
- Drag and drop a “Salesforce Table” and a “JavaScript” field onto your form.
- Rename the fields as needed.
- Configuring The “Salesforce Table” Field:
- Click the pencil icon of the “Salesforce Table” field.
- Set “Object” and “Select Table Column” as shown below.
- Update the “Custom Table Columns” options as shown below.
Note: Please check out this guide on how to use the “Salesforce Table” field- https://guides.formyoula.com/public-guides/salesforce-table-field
- Configuring The “JavaScrip” Field:
- Click the pencil icon of the “JavaScrip” field.
- Paste the code.
- Save the changes.
- Please use this code.
//Listen to SFDC Table row button clicks
$( 'body' ).on( 'click', '.formyoula-SalesforceTable-row-button', function() {
// Get the value of the clicked button
var record_id = $( this ).val();
// Open a new window with the Formyoula URL, passing the button value as a parameter
window.open( 'https://app.formyoula.com/mobile?auto_sign_in=true&form_id=668e0e82822f6c00157f1378&7531-221d-c221=' + record_id );
} );
The Second Form -
It will launch by clicking the table button on the First form and will prefill the record ID in the Lookup field.
- Initial Setup:
- Drag and drop a “Salesforce Lookup” field onto your form.
- 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” as shown below.
- Test Your Form:
- The First form will show the Opportunities.
- Clicking the table button will open the second form with the pre-filled record ID.
For any questions, please contact us - [email protected] or the Formyoula in-app chat. 🙂