🔺 Auto-generating dynamic prefill links using an Apex Class trigger requires the "Author Apex" user permission which is not available in all editions of Salesforce. If available in your edition, it must be granted to the Primary Formstack app user using the profile or permission set. See this article to verify which Salesforce editions support it and how to enable it.
This guide will highlight the main reasons why auto-generated prefill URLs fail to generate and how you can troubleshoot and resolve the issue. Below, are the potential error messages and issues you may run into and how you can resolve them.
- Records created in Salesforce manually (aka not from a form) are not generating a URL
- The following error message appears: Oops! Something went wrong when attempting to enable auto-prefill for your form. This may be due to some validation rules on your primary object.
- Clicking the Update button never generates prefilled URLs
Records created in Salesforce manually (aka not from a form) are not generating a Prefilled URL
Included with your Salesforce App is a Permission Set called Formstack Utility Permissions. Assign this Permission Set to any and all users who are expected to create records that include prefilled URLs. This will give your users the necessary permissions that will allow the auto-generated prefill feature to fire when they create a new record in Salesforce.
For more information on how to assign Permission Sets, please review this article from Salesforce here.
Records created in Salesforce manually (aka not from a form) are not generating a Prefilled URL and I have assigned the Utility Permissions Set.
Sometimes, certain Process Builders or Flows can prevent our Prefill feature from creating the necessary Apex Trigger to generate prefill URLs. We recommend temporarily disabling the automation, and completely turning off the prefill feature. Then, turn the prefill feature back on again to generate the Apex Trigger.
You can have the user who created the Salesforce record attempt to save a change to the record and note what validation error is taking place.
The following error message appears: Oops! Something went wrong when attempting to enable auto-prefill for your form. This may be due to some validation rules on your primary object.
This error message is typically caused by validation rules and/or Process Builders and Flows associated with your form's primary object. To resolve this issue, we recommend temporarily disabling all of the following on the form's primary object:
- Validation rules
- Multiple required lookup fields
- Certain Process Builder processes
- Custom triggers/flows
You can then try re-running the 'Apply for New Records' process. Usually, temporarily disabling validation rules and any automation(s) on the object will allow the process to run successfully.
When the Prefill feature is enabled, it creates a Trigger and Test Class. The Test Class in the background essentially "submits" all of the required fields on the form (it does not create a record, it is just to test the validity of the Trigger.). However, if the Test Class submitted does not meet the criteria of any of 1-4 above, it can prevent the Trigger from being created. This is why it might appear the prefill trigger was generated but fails to create a prefilled URL when creating a record manually.
If you are unable to do the above, you may be able to write your own Apex Trigger to generate the prefilled URLs. This will be something you need to develop on your own, though we may be able to connect you to a Partner who can build this trigger if you do not have a Developer on staff.
Clicking the Update button never generates prefilled URLs
If you click the update button to generate the URLs and nothing appears to happen, we recommend you check the following:
- Please ensure the URL field for Prefilling is only used with one form. At this time, we recommend one URL field per form you want to prefill.
- If you are using the standard List View that looks at All records, try using a Custom List View. This List View can still look at all records.
- Attempt to update the record manually and check for any validation errors that may be getting thrown. If you can't edit the record directly neither can the Update Existing Records process.
- It might be possible that Support needs to help adjust the number of records we process at a time. Sometimes, if the number is too large it can time out. If you have tried all of the above in this article and still cannot generate the prefill, please submit a Support Request and we will check this setting.
Prefill Apex Trigger Times Out When Creating Prefill Links
Occasionally the prefill link update process can time out when attempting to update multiple existing records and prefill URLs will not appear on the records within your list view. This happens when your Salesforce Org has reached its CPU limit.
To fix this issue you can modify the batch processing sizes for our application's prefill process. Reducing the size of each batch will make the operation run a longer period of time but should prevent any errors related to exceeding CPU limits.
Follow the steps to update settings for a particular process.
- Go to Setup
- In the quick find box type in 'Custom settings'
- Look for 'PrefillLinkProcessSettings'
- Click on 'Manage'
- Click on 'Edit' for the corresponding record (Synchronous/Asynchronous/AsynchronousBatch)
- Update 'Custom' with the new value
- Click 'Save'
Note: Make sure Asynchronous's 'Custom' value is more then Synchronous's 'Custom' value, otherwise Asynchronous process won't get triggered at all. i.e. If Synchronous 'Custom' value is 200 then Asynchronous 'Custom' value should be 201.