Hi,
Scenario:
- I have a SmartBox SmartObject which is used to store customer records.
- Currently, I am using the ID field as a displayable reference number, so that the User can keep track of a particular record during a Workflow etc.
This works well in basic terms, as by default, K2 sets this field as an Autonumber (i.e. 1, 2, 3, ....). So will be unique (for that SmartObject).
Issue:
The reference is not unique across all smartobjects, a prefix is required within the reference number so that the User knows which type of record they are dealing with.
Requirement:
Amend the format of the Reference number.
The Reference Number should be prefixed and be a fixed number of digits. Examples: (FA00001, FA00002, FA00111).
Best Practice Query:
How would most people go about generating the Reference Number?
Idea:
Would you get the ID back after the record has been created, then somehow generate the Reference Number using a Rule prehaps (?), then do an update on the Row storing the generated reference number?
Example:
- Record is created with ID 63
- ID is returned in Output Mappings
- Then a Rule (?), to generate a Reference number of FA00063
Is the Rule part possible? I know how to do this in code (i.e. C#), but unaware of best way to do this K2.
I want to avoid doing any development outside of K2.
- I'm using a SmartBox, so table is hosted in K2.
- I'm aware a SQL trigger could be done against the K2 SmartBox Database table but trying to avoid that.
Thanks