Tag: custom button

Drawloop Button: Specific error for multiple criteria

Problem: Members of the Sales Team must fill in the Next Step and Campaign fields on an Opportunity in order to generate a Quote document using Nintex Drawloop Document Generation. If the ‘Generate Documents’ button is clicked and one of the fields is blank an error message specifying the blank field should be presented to the user.
Solution: Use the sample syntax below:


Drawloop Button: Grab attachment with specific name for generated document package


You only want Users to be able to generate a document when an attachment with a specific name exists for that record. Also, the attachment should be included in the generate document package.


After configuring the Salesforce approval process, create a custom button using the sample syntax below:


Drawloop Button: Lock ‘Generate Document’ button until approval is given via an approval process


You would like Users to generate a document ONLY after the record has gone through an approval process.


After configuring the Salesforce approval process, create a custom button using the sample syntax below:

MassLOOP: Automatically Set Email Notification Preference


Each time you run a MassLOOP in Drawloop Document Generation you will automatically receive email notifications that the process has:

  • Began
  • Completed
  • Encountered an error for one or more records

Many users prefer to customize this setting to only receive an email notification when an error is received or when the process ends rather than receiving all three of these emails.

Who receive these notifications? The owner of the Document Package (DDP record) and the User running the MassLOOP.


In order to adjust this setting you will need to add the ‘&batchnotification=’ parameter to your custom button along with the appropriate value (listed below). The entire string should look like this: &batchnotification=ON_ERROR.

BEGIN_AND_COMPLETE  –  Only receive emails when the MassLOOP begins and compeletes.
ON_COMPLETE  –  Only receive an email when the MassLOOP compeletes.
ON_ERROR  –  Only receive an email when the MassLOOP has an error.
NONE  –  Never receive emails.



Sample Code:



Drawloop Button: Error when a field has no value


You would like a User to only be able to run a DDP from an Opportunity record if the Type field has a value, otherwise you would like the User to receive an alert stating the Type field must be entered first.



Using JavaScript we will create a custom button that will evaluate the field, ensure it meets the criteria and if not, present the User with an error.


Get the button code here: Error based on field criteria



1. In Salesforce, navigate to an Opportunity record.
2. Click the arrow on the right-hand side of the page.
3. Select View Object
4. In the left-hand menu, select ‘Buttons, Links, and Actions’
5. Click the ‘New Button or Link’ button
6. Provide the button with a Label. The value provided will be cloned in the Name field as well.
7. Set the Display Type to ‘Detail Page Button’.
8. Set the Behavior field to ‘Execute JavaScript’. The Content Source field will change to ‘OnClick Javascript’
9. Insert code:

10. Click ‘Check Syntax’ to ensure there are no errors.
11. Click ‘Save’.

Once the newly created custom button is added to the page layout you’re all set!



Further Customization:

Change the Field:
Replace the {!Opportunity.Type} merge field tag with the merge tag for the field you would like to evaluate.

Change the Alert Message:
Replace You cannot generate a document unless Type has a value with the new alert message.