Knacks Rules are built for power as well as protection. I’ve had an issue with the Conditional Field option that may be helpful for creating/editing unique identifiers for records. Such as invoice and order numbers.
I created a complex formula to create a unique Purchase Order Number 31456-RKH182. 31456 is the auto increment, RKH is the employee requesting the order, 18 is the year and 2 is the month. I needed to assign this formula result to the Purchase Order Number field in my record BUT I wanted the end user to be able to edit this unique number. To accomplish this I had to use a special sequence of Knack functions. Otherwise it would not work.
- Create a Text Formula field called ‘Purchase Order Generator’ to generate the unique alpha numeric Purchase Order
- Create a ‘Purchase Order field’ (short text)
- Put the editable ‘Purchase Order field’ on my ‘Purchase Order Edit Form’
- Back to the ‘Purchase Order object’ and open the ‘Purchase Order field’
- Create a Conditional Rule ‘when the Purchase Order is blank then Purchase Order =Purchase Order Generator’
Now Knack creates a unique identifier for my Purchase Orders AND the end user can edit it later if changes need to be made. The ability to edit a conditional field depends on the order in which you perform Knack tasks (from list above) #3 Add editable Purchase Order to the Editable form #5 Create the conditional rule to auto assign the Generated Purchase Order Number to the Purchase Order field.
If you create the Rule first, the field will not be available from the pick list for addition to your Edit Form.