Defined a function and then it doesn't exist.

Defined a function and then it doesn't exist.

This error has occurred twice with the same function.

In my Maintenance_2 app.  I defined a function to generate a code.  

The function takes three parameters.  Generates a code.  The checks to make sure code is unique.  If it is not, it moves the parameters around and invokes itself recursively.

I entered the following code:
string codes.code_generator2(string fname, string lname, string full_name) { day_num = zoho.currentdate.getDayOfWeek(); if (day_num == 1) { day_name = "Sunday"; } else if (day_num == 2) { day_name = "Monday"; } else if (day_num == 3) { day_name = "Tuesday"; } else if (day_num == 4) { day_name = "Wednesday"; } else if (day_num == 5) { day_name = "Thursday"; } else if (day_num == 6) { day_name = "Friday"; } else if (day_num == 7) { day_name = "Saturday"; } time_seconds = zoho.currenttime.getSeconds(); time_minutes = zoho.currenttime.getMinutes(); code = ((((((day_name).subString(2,3)) + (time_seconds % 7 + 2)) + (input.lname).subString(2,3)) + (((input.full_name).length() % 9))) + (day_name).subString(1,2)) + ((time_minutes % 8 + 1)); if (count(mrequest[access_code == code]) > 0) { code = maintenance_2.codes.code_generator2(lname, full_name, fname); } return code; }

But what it recorded was:

string codes.code_generator2(string fname, string lname, string full_name) { day_num = zoho.currentdate.getDayOfWeek(); if (day_num == 1) { day_name = "Sunday"; } else if (day_num == 2) { day_name = "Monday"; } else if (day_num == 3) { day_name = "Tuesday"; } else if (day_num == 4) { day_name = "Wednesday"; } else if (day_num == 5) { day_name = "Thursday"; } else if (day_num == 6) { day_name = "Friday"; } else if (day_num == 7) { day_name = "Saturday"; } time_seconds = zoho.currenttime.getSeconds(); time_minutes = zoho.currenttime.getMinutes(); code = ((((((day_name).subString(2,3)) + (time_seconds % 7 + 2)) + (input.lname).subString(2,3)) + (((input.full_name).length() % 9))) + (day_name).subString(1,2)) + ((time_minutes % 8 + 1)); if (count(mrequest[access_code == code]) > 0) { code = thisapp.codes.code_generator2(input.lname, input.full_name, input.fname); } return code; }

Then when I go to use the script builder to define a variable in the form, the function is there:


and then it isn't:


The app has been shared with support.

Any thoughts?

Thanks,

Brian