Skip to content

Generate Identifier with your entities

hncrm edited this page Aug 25, 2017 · 4 revisions

How to use the Identifier Generator

Once Identifier configuration item has been created, the next step is to generate the unique identifier and associate with one or more attributes within your custom or out of the box entities. The Identifier Generator supports a couple of ways to generate a unique identifier for your entity.

  1. Client side - This approach provides the ability to generate the unique identifier from the client side within your Form. It provides an easy way to present to the end-user the generated Id prior to have the record created.
  2. Workflow - This approach provides the ability to generate the unique identifier as part of the entity record creation process.

Generating the Identifier on the Form - Client side

This approach is preferred if the requirement is to generate the Identifier prior to saving the entity record. It also enables the developer to modify the generated Identifier with Form context information.

To use Identifier Generator in your form simply perform two steps

  1. Import the Form Library "hn_/Scripts/Identifier.js" to your form
  2. Add the following Event to your Form OnLoad Event Function: hn_GenerateId Parameters: 'IDENTIFER_CONFIG_NAME', 'FORM_ATTRIBUTE_NAME'
  • IDENTIFIER_CONFIG_NAME: This is the value from Name attribute of the Identifier configuration record.

  • FORM_ATTRIBUTE_NAME: This is the underlying Field Name of your form attribute. Not the display name of the form attribute.

NOTE: Do not select 'Pass execution context as first parameter'

Generating the Identifier using Workflow

This approach is preferred if the requirement is to ensure the sequence of the generated Identifier is consistence as only each saved record will have a unique identifier recorded.

To use Identifier Generator with your workflow simply

  1. Add the 'HN.CRM.Identifier.Generator' to your workflow with the following settings configured
  • Config: Select the Identifier configuration record from the list of available active Identifier configuration records.
  • FieldName: This is the underlying Field Name of your form attribute. Not the display name of the form attribute.