Exception on plugins.file.showFileOpenDialog

While in developer testing in debug mode the application failed to call the callback function. I put a try catch block and found this error:
FATAL Exception: Can’t find method com.servoy.extensions.plugins.file.FileProvider.js_showFileOpenDialog(number,null,boolean,[Ljava.lang.Object;,com.servoy.j2db.persistence.ScriptMethod,string). (K:\Flying_Club\FlyingClubTuition\forms\student_import_csv.js#40)

I have two other places of the same code and they work. What could I have done to whack this file?

Here is the code:
function onAction_import_student_from_flight_sheet() {
scopes.ui_converters.progress_messages = ‘’;//clear
scopes.ui_converters.output_progress(‘Starting Import for Student Information’);
try{
// var obj = plugins.file.showFileOpenDialog(1, null, false, new Array(“csv and txt”, “csv”, “txt”), callback_function_csv_file_selected);
// plugins.file.showFileOpenDialog(1, null, false, new Array(“csv and txt”, “csv”, “txt”), callback_function_csv_file_selected);
var obj = plugins.file.showFileOpenDialog(1,null,false,new Array(‘csv and txt’, ‘csv’, ‘txt’),callback_function_student_csv,‘Select Student csv to import’)
} catch(e){
var msg = 'Exception: ’ + e.message;
plugins.dialogs.showErrorDialog(‘Import Student’,'Exception: ’ + e.message,‘Ok’);
scopes.ui_converters.output_progress(msg, LOGGINGLEVEL.FATAL);
return;
}

And the start of the callback is:
function callback_function_student_csv(files) {
scopes.ui_converters.resetProgress();
var msg = ‘’;
if(!files){
msg = “ERROR no files selected”;
scopes.ui_converters.output_progress(msg);
plugins.webnotificationsToastr.error(msg);
return;
}

Servoy 2025.6.2.4084, windows 10, Firefox Browser

I have had this and reported it to Servoy, who could not replicate it. I rewrote the logic like it shows in the latest documentation and it worked right away.

  1. From SVY-20375

On closer inspection it is the plugins.file.showFileOpenDialog that fails.

plugins.file.showFileOpenDialog(1, null, false, new Array(“txt files”, “txt”, “txt”), import_callback);

used to work. I managed to get it working reading the documentation and changing it to

plugins.file.showFileOpenDialog(import_callback);

Maybe there has been some change to the params and I’m calling it the old way.

Hope this helps,

Christian

Nope get the same error!
Thanks for replying though.
Perhaps it is related to the Rhino debugger?
Strange that the other two places I use it in almost identical forms are working just fine.
Perhaps the form script file is corrupted.
Perhaps the Firefox browser is strange.

More testing:
if I duplicate the form - get the same error.
If I create a new form and copy the code over from the original to the new form (for this call) then it works.
How can I check the integrity of the original form which appears to have some ‘weirdness’ ?

Servoy 2025.3.1 Mine worked in developer but failed when deployed to Servoy Cloud.

Found the CAUSE:
After a couple of hours of adding in code a little at a time to see where it fails I finally found this line:

  			msg = 'Updating student ' + studentObj.client_id + ' ' studentObj.last_name + ' ' +  studentObj.first_name;

I examined this several times before seeing the error:
+ ’ ’ studentObj.last_name

of course it should be
+ ’ ’ + studentObj.last_name

Apparently the syntax checker fails to spot this.
To my surprise the runtime must have some memory failure or corruption to make the original error message.

Maybe some one else could test this peculiarity.

The syntax checker seems very sensitive to missing ; (semicolons) at the end of lines, and they should really be optional…