Generate Invoice Number Using Salesforce Object Auto Number Name

This guide will explain how to prefill a unique number on each form submission using the Salesforce Auto-Number field.

We will use the “Salesforce Create Record” to create a new custom Object record on page load and the “Salesforce Pre-Fill” to populate the auto-number on the form.

  1. Please create a new custom Object in your Salesforce where the Name is an auto-number field:
image
image
  1. Please create a new “Type’ picklist field on the new Object with the necessary values:
image
  1. Please Drag&Drop Select, Hidden, and Text fields on your form:
image
  1. Please Drag&Drop a Salesforce Create Record field on your form and please make the below changes:
  • 1. Please input the custom Object Name
  • 2. Please select the “Create Record On Page Load” as “Yes”
  • 3. Please map the Type field on your form to the Type field in your Salesforce.
image

[Optional] You can set a custom success message when the custom Object record is created in Salesforce:

image
  1. Please Drag&Drop a Salesforce Pre-Fill field on your form and make the below changes:
  • 1. Please select the custom Object.
  • 2. Please set the Salesforce Create Record as the Formyoula Parent field.
  • 3. Please select the Record ID (Id) as the Salesforce Parent field.
  • 4. Please map the form Hidden field to the Name field in Salesforce.
image
  1. Please Drag&Drop a Field Update Workflow field and make the below changes:
  • 1. Please set the Rule Criteria for the Type field to equal the value Invoice.
  • 2. Please set the Field Update for the Number field to capture a prefix and the Hidden field merge ID. For example, INV-{{c40c-3fae-57d6}}
  • 3. Please set the “Evaluate Workflow On Page Load” as “No”.
image
  1. Please Drag&Drop another Field Update Workflow field and make the below changes:
  • 1. Please set the Rule Criteria for the Type field to equal the value Quote.
  • 2. Please set the Field Update for the Number field to capture a prefix and the Hidden field merge ID. For example, Q-{{c40c-3fae-57d6}}
  • 3. Please set the “Evaluate Workflow On Page Load” as “No”.
image

Now, once we start the form, the custom Object record will be created in Salesforce which generates the auto-number field, and this field will be displayed with the necessary prefix once the Type field is selected:

Type Invoice:

image

Type Quote:

image
image

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