GlideDialogWindow

Lohith
Giga Expert

Hi All,

I have a requirement like,

Condition : when supplier field on incident table is Vendor

Requirement : when condition is met, I need to create a glide dialog window, which opens a survey page. user will fill out the survey page and clicks on save button on dialog window, Page should remain on parent window ie on current incident form, At this point of time incident form should not be saved, user will still edit fields on current incident form and then clicks on save.

Any inputs will be greatly appreciated, Thanks

Regards,

Lohith

1 ACCEPTED SOLUTION

The client script for generating the window is pretty simple.   Since you are looking for one specific vendor as the supplier then you can hard code the sys_id in the client script and whenever someone puts that value in the supplier field it will pull up your UI page.   That part you will have to build to look the way you want and store the results in whatever table/fields you are interested in.



function onChange(control, oldValue, newValue, isLoading, isTemplate) {


if (isLoading || newValue == '') {


  return;


}



//Type appropriate comment here, and begin script below



if(newValue == 'sys_id_of_vendor')   // Enter the sys_id of Vendor


  {


  var dialog = new GlideDialogWindow('your_ui_page'); // Change this to your UI page


  dialog.setTitle('Vendor Survey'); // Change this to whatever you want the title bar of the dialog to say


  dialog.render();


  }


}



-Steve


View solution in original post

9 REPLIES 9

Hi Stephen,



perfect!!!! worked



Thanks


Lohith


Hi Stephen,



As you said, we need create UI page to display Survey. Than call the UI page from client script. Can you help me out like how we can display survey from UI page ?



Thanks.


There is a UI page called survey_take that the system uses to display surveys.   You may be able to use that and just pass the correct parameters to the UI page to display your specific survey, but I don't know how hard it is to make that work.   If you can't use that page, you may be able to copy it and restructure it a bit to display the survey you are interested in.



-Steve


Hi Stephen.
I have similar script :


if(newValue == '4')


      {


      var gdw = new GlideDialogWindow('VendorDetails');


      var incidentSys_id=g_form.getUniqueValue();         //Get Incident sys id


  gdw.setTitle('Third Party Ticket Details');


  gdw.setSize(500,200);


  gdw.setPreference('sysID', incidentSys_id);


  gdw.render();


           


      }


Its working fine.
but i want to read value when the rendered box is closed via "X" button on top right corner.
how to read that condition


I don't believe there is a way to capture the value when the box is closed with the "X" button on the top right corner.   That button simply closes the window shown by the browser and doesn't generally run anything. You can attach some javascript to the dialog window that tries to keep it from closing, but it isn't always reliable.   The safer thing is to just make sure you get a valid value back and adjust your processing on the main page if you don't.



-Steve