Ajax even not working in production

Good afternoon,

In my production environment this code is not working

// Check for record
$check_sql = “SELECT hardwareID, typeDesc, hwModelDesc, vendorname, warrantyEndDate "
. " FROM hwalldet”
. " WHERE hardwareID = ‘" . {hardwareID} . "’";
sc_lookup(rs, $check_sql);

if (isset({rs[0][0]})) // Row found
{
{hwType} = {rs[0][1]};
{hwModel} = {rs[0][2]};
{vendor} = {rs[0][3]};
{warrantyEnd} = {rs[0][4]};

}
else // No row found
{
{other_field} = ‘nothing’;
{other_region} = ‘more nothing’;
}

I am given this error

Uncaught ArgumentCountError: Too few arguments to function newTicket_apl::hardwareID_onChange(), 0 passed I have the very similar code (different tables and fields) working elsewhere in production so I am not sure what I am missing. Thanks, Keith

If this is working in development, then it could be that uploading went wrong. Did you retry? Sometimes deleting the runtime fully and then re-upload, cleaning browser cache and cookies can help. If then the issue persists it looks like a bug, and you can report that to bugs @ scriptcase.net

I will retry and let you know the results. I did try clearing the browser already but that did nothing

Just to be safe and since the production is not fully live yet I cleared everything out, did a typical deployment, uploaded the zip and extracted it. I also cleared the browser again but I get the same issue.
the strange thing is that this code works fine on the same form.

// Check for record
$check_sql = “SELECT idsoftware, vendorname, softDesc, licenseCount, subscripEnd "
. " FROM swalldet”
. " WHERE idsoftware = ‘" . {softwareID} . "’";
sc_lookup(rs, $check_sql);

if (isset({rs[0][0]})) // Row found
{
{softwareName} = {rs[0][1]};
{swDesc} = {rs[0][2]};
{swLic} = {rs[0][3]};
{swSubEnd} = {rs[0][4]};

}
else // No row found
{
{other_field} = ‘nothing’;
{other_region} = ‘more nothing’;
}

Hello, we’ll make some tests and give you a feedback.

I dug through the production code and it added a variable to the Ajax function the code had
hardwareID_onChange($softwareid)

once changed to

hardwareID_onChange()

the code works.

Hi there,

I had the same problem KeithK and thanks to your post i found the way to fix it with the Scriptcase:

  1. go to the onchange event
  2. in the botom unfold the parameters list and doble click the one that is marked with *
  3. save it manualy because scriptcase does not detect the change, so save it
  4. generate the app again and try

Thas a horrible bug my dear Scriptcase staff. Please check it. I even bougth another hosting service thinking that the production environment was the problem.

Regards,