Scenario Overview
In this business scenario the customer wants a record type to have a Case ID that populates on the creation of the record. They want the Case ID to be:
- Random
- 7 digits
- In integer form
- Be a unique number
North52 Decision Suite Steps
The following set of steps outline how to create this Formula:
- A formula of type Auto Number is created on the Case entity:
- The Event is set to 'Create'
- The Auto No. Value is set to '1234567'
- The Source Entity is set to 'Case'
- The Source Property is set to 'Case Number'
- The Target Entity is set to 'Case'
- The Target Property is set to 'Case Number'
- Copy and paste the formula provided below into the formula editor
- Click Save
- It is now ready to test
Formula
SmartFlow(
SetVar('UniqueNo',
ToString( AutoNumber([incident.ticketnumber]+1))
),
SmartFlowReturn( Substring(GetVar('UniqueNo'), 6, 1) +
Substring(GetVar('UniqueNo'), 4, 1) +
Substring(GetVar('UniqueNo'), 2, 1) +
Substring(GetVar('UniqueNo'), 0, 1) +
Substring(GetVar('UniqueNo'), 1, 1) +
Substring(GetVar('UniqueNo'), 3, 1) +
Substring(GetVar('UniqueNo'), 5, 1)
)
)