Check if text in field already existsalready exists
Posted: Mon Mar 06, 2023 8:33 pm
Hi,
I've made a function that makes a code from the initials of a customer name. The code is put into a field called 'newcode' and is later used as the index of the customer line in a database. How can it be scripted to check if the code made already exists, and if it does, to suffix this latest instance of it incrementally (by 1) to distinguish it from one or more previous similar codes? I've tried using the 'exists' and 'there is ' functions without success or any idea of the syntax for this context.
I've made a function that makes a code from the initials of a customer name. The code is put into a field called 'newcode' and is later used as the index of the customer line in a database. How can it be scripted to check if the code made already exists, and if it does, to suffix this latest instance of it incrementally (by 1) to distinguish it from one or more previous similar codes? I've tried using the 'exists' and 'there is ' functions without success or any idea of the syntax for this context.