Good day, all. I am having a very strange issue I've never seen before. A client's database appears to be mutating the values of script (local) variables in the middle of script execution. Some details:
The database is a child care center's management system. It's rather large and complex, but the features that are malfunctioning are fairly straightforward. The database is accessed from desktop and iPad clients, all server hosted.
The script in question stores various elements of data in local variables, then uses those variables to send out an email. What is extremely strange is what's going on with the script. It sets certain variables at the beginning of the script, and then they appear actually to change value in the midst of execution. The client reports this is only happening on a couple of machines. The issue is intermittent; it doesn't always happen, even from the two suspect machines.
They first reported that the machines had version 14 installed with a 15 server, so I thought perhaps that had something to do with it. They upgraded to v15, but there has been no improvement in the situation. I've copied some relevant bits from the script in question below.
The first and last name of the child are set in lines 14 and 15:
At line 106, those variables are used to set the subject of the email:
I can verify that the variables are correct at this point, because the subject of the email is correct, as are the email addresses it forwards. (Which also means nothing has messed with the variables from line 16 to line 106.) But this is where it gets really weird. At line 111, the body of the email is set using the same variables:
The wrong child's name is applied at this point. Here's every step between 106 and 111:
There are no Script Triggers on either of the involved layouts. Somehow, from doing nothing more than showing all records, switching layouts, and creating a record, the local variables are being changed. This includes several other variables that are in the body of the report.
The variables are being changed to another child's data. I've looked at instances where incorrect emails are being sent, and sometimes there are two emails being sent at nearly the same time. The second child involved is the one whose data are appearing in the wrong email. I've never heard of one client messing with another client's script variables before, but this is what it appears to be.
I'm perplexed. Has anyone seen anything like this before? Could there be maybe a hardware or OS issue with the clients involved?