I have a "Merchant" content type created for a web site. The Merchant content type has a select field called "City" and a text field "Locality".
I want to create a "merchant_code" field that has to be something like "AB-XY-0001" where AB is first two letters of the City Name and XY is first two letters of the Locality Name and 0001 must be an incremental number, so Merchants of ABCD City and XYZ locality will have each a different code:
"AB-XY-0001",
"AB-XY-0002",
"AB-XY-0003"...
"AB-XY-9999",
etc.
And Merchants of PQRS City and LMN locality will have each a different code:
"PQ-MN-0001",
"PQ-MN-0002",
"PQ-MN-0003"...
"PQ-MN-9999",
etc..
I see that there is a Serial module, but that module helps me only creating autoincremental numbers for each content type, not based on other fields of that content type.
If I create Merchant "AB-XY-0001" and then create another Merchant of City PQRS and Locality LMN, it will have "PQ-LM-0002" code, and not "PQ-LM-0001" code.
Please help me achieve this.