The CreatorCon Call for Content is officially open! Get started here.

OK and Cancel buttons on pop-up - Resolve dialog form view

adinad
Tera Guru

Hi,

In problem workflow, I edited the form "Resolve dialog form view" and want to be displayed as pop-up on "Resolve" button. 

I edited the UI Action - Resolve, with the script:

--------------

function onResolve() {

var tableName = 'problem';
var sysID = g_form.getValue('sys_id'); // sys_id of the record you want to show

//Create and open the dialog form
var dialog = new GlideDialogForm('Resolve', tableName);
dialog.setSysID(sysID); //Pass in sys_id to edit existing record,
dialog.addParm('sysparm_view', 'resolve_dialog_form_view'); //Specify a form view
dialog.render();

}

--------------

The correct pop-up is displayed, but are missing Ok and Cancel buttons.

I edited also, in the Ok and Cancel buttons, in list - UI Action Visibility - to include the view "Resolve..", but still, the buttons are missing on the pop-up.

Am I missing something?

Thanks,

Adina

1 ACCEPTED SOLUTION

adinad
Tera Guru

After I created a dedicated client script for the resolve view and field "

 

The client script - Modals for Problem state transition - didn't impacted in any way the other views.

View solution in original post

22 REPLIES 22

When you say "But I wanted to used the OOB views." what does that mean?

Can you elaborate on your requirement when the pop up should be loaded?

Regards,

Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hi,

From Quebec version, the problem module is using some modals in UI Actions; except the resolve button.

There is a dedicated view for resolve action, but is not used. I want to pop-up this view when I click the button Resolve, like the other ones - Accept Risk, Fix,... - they all use pop-ups for dedicated views.

Okay got it now.

The way it works OOB is mentioned below:

1) For example when you click on "Assess" button, a popup/modal is displayed for which within the UI action ServiceNow OOB calls a UI Script named as "ProblemModalUIHelpers" as shown below as well where all the functions for different buttons are written.

For example, for Assess button below is the function which gets executed "ProblemModalUIHelpers.onAssess" as shown below:

Navigate to UI Script module and search for Name as "ProblemModalUIHelpers"

find_real_file.png

find_real_file.png

My suggestion would be do not customize this OOB UI Script component as there can be impacts(might get skipped and you may miss some important updates) when you upgrade to higher version.

If you need exactly similar thing create a new UI Script and use the same approach as ServiceNow OOB is doing . Refer to one of the actions highlighted above.

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

I don't want to change the UI Script - ProblemModalUIHelpers. I just want to open an existing view (this is working), but somehow the buttons OK and Cancel are restricted on the pop-up.

When I change the view manually, I can see OK and Cancel, but on pop-up not.

If is not working, I'm going to use a UI Page.

Thanks,

Adina

Are the buttons grayed out? Are you able to see the buttons when the pop up opens up?

If button are grayed out then did you checked do you have the access to update the Problem record?

 

Regards,

Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke