What are the parameters for the GlideDialogWindow callback function?

will_smith
Mega Guru

I am having problems with this callback function in the GlideDialogWindow as I cannot figure out what it's returning. I am a new admin/developer in ServiceNow needing some help from the community. This took me 2 weeks to get sorted out, but I finally have it writing to the comments field successfully. Is this returning the sys_id of the username? I'm looking for it to return the username given in the form. Thank you in advance for your help.

function newCredentialForm(){

  var tableName = g_form.getTableName();

  //Get the values from the Incident Table

  var comments = g_form.getValue('comments');

  var work_notes = g_form.getValue('work_notes');

  var short_description = g_form.getValue('short_description');

  var num = g_form.getValue('number');

  //Create and open the dialog form

  var dialog = new GlideDialogForm('Create Temporary Credential', 'u_temp_credential', callbackFunct);

  dialog.setSysID(-1); //Pass in sys_id to edit existing record, -1 to create new record

  dialog.addParm('sysparm_view', 'credential_view'); //Use the Credential view of the form

  dialog.addParm('sysparm_form_only', 'true'); //Remove related lists

  dialog.render(); //Open the dialog window

  }

//this is my callback function.   All I am doing is taking the username and using the setValue to place it in the additional comments field.

function callbackFunct(action, sys_id, table, displayValue) {

  g_form.setValue('comments',sys_id,'u_temp_credential','u_username');

}

1 ACCEPTED SOLUTION
5 REPLIES 5

Thanks William!



You can click on the below link and mark one of the answers as correct. That action can only be completed by the person who opened the thread (in other words... you ). This is the way a thread can be closed:



What are the parameters for the GlideDialogWindow callback function?



Thanks for your support!



Berny