Automatic Numbering from Customer's Criteria

Hello Eldy.
Greetings of the day.

I have Installed and started learning Dolibarr 19.0.1. It is like a charm and full with features. I found it more powerful than SAP.

I have a question on Automatic Numbering of each Third Party Like this :
TP Name : ABC Cement
TP Type : Customer
TP Country : India (IN)
TP State : Gujrat (GJ)

So Code will be “C8I-AC(IN)-(GJ)-000001”
Where, C8I = Prefix (anything Predefined)
AC = A(First Letter of Party), C(first letter of Type - C/P/V)
(IN) = Country Code
(GJ) = State Code
000001 = Serial Number

Similarly “C8I-AV(IN)-(GJ)-000001” for Vendor & “C8I-AP(IN)-(GJ)-000001” for Prospect

How to apply this mask.

Kindly help.
Regards
Alok