Hi,
I have Students Model and I'm trying to set the field subscr_code depending on the field Category :
If Category is 'E' : subscr_code would be in [ 0001 -> 9999]
If Category is 'D' : subscr_code would be in [0001 -> 9999]
If Category is 'C' : subscr_code would be in [0001 -> 9999]
I want to query the max value of subscr_code where the Category == 'E' (for example) and then increment this value and set it in the new record.
How can I do this ? Can anyone help me please ?