Hi;
I am trying to create a unique identifier for each record that is saved using a form in a model-driven app. The identifier should be generated by combining values from three other fields in the form based on specific criteria. To achieve this, I have implemented a JavaScript function that will run when the form is saved.
The form contains two choice fields, one date field, and a read-only simple text field where the generated ID should appear after saving the form. The JavaScript function uses the first two letters from choice field 1, assigns another letter based on the year selected in the date field, and assigns a sequential number with an increment of 1 based on the selection from choice field 2. I added the function to the on save event handler on the main form. However, the function is currently returning an empty result when the form is saved, and I'm unable to identify the cause of the issue. What possibly can be wrong here? and is there another way to achieve this logic?