Hi
Using my current accounting software, every time I add a customer it gives me a unique code which consists of the first 4 letters of the company name followed by a 2 digit code i.e. Boggs, Joe would be BLOG01 and Bloggs, Stephen would be BLOG02 as BLOG01 already exists. Is this possible with Airtable?
To add to this, if a Company name doesn’t exist, I want it to create the code using the surname.
So far the following code will take the information from the Company field, remove any unwanted characters or spaces, change the text to uppercase and add a 2 digit number which is taken from the ID field (Auto number).
UPPER(LEFT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE({Company}," “,”"),",",""),".",""),"/",""),"?",""),";",""),":",""),"’",""),"-",""),"!",""),"@",""),"&",""),"_",""),"+",""),"+",""),4)) & RIGHT(‘0000’ & Autonumber,4)
This next code will fill the cell with the first name unless there is content in the Company field.
IF({Company}>"", {Company}, {First Name})
What I can’t figure out is:
How do I combine Surname and First Name on the second part of the code?
How do I combine the first code to the second code so if company does exists then create the code from that otherwise create the code using the surname?
How do I then lock that cell so that if I change the company name or surname then the code will remain the same?
How do I stop it duplicating?
Thanks