Hi there,
I want to autopopulate a unique field per record load. I got the script and instructions for this from suppport, see below:
- Add a new form with name MaxValueHolder form to your application. Add a number field named "highestval" to this form, to store the value.
- Add a record to the MaxValueHolder form with a starting value that needs to be incremented sequentially, ie, enter 18000
- In the AOE PEST CONTROL Form, add the following code in the on add -> on load block of the script tab, to fetch the highestval, increment it by 1 and append the required string to this number.
- x = MaxValueHolder [ID != 0];
- temp = (x.highestval + 1);
- input.num = "PC" + temp;
- In the AOE PEST CONTROL Form, add the following code in the on add -> on success block of the script tab, to update the latest highestval in the MaxValueHolder form
x = MaxValueHolder [ID != 0];
x.highestval = (x.highestval + 1);
The problem is that this is used concurrently by a number of users and we need it block out anyone else using the unique No. whilst the add screen opens. Currently we are duplicating unique No.s using this meathod above.
Can anyone help?
Thanks
Patrick