- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2021 04:45 AM
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
Solved! Go to Solution.
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2022 11:15 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-31-2021 03:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-01-2022 08:08 AM
For problem, there are dedicated UI Actions for OK and Cancel button
- This UI action is for the cancel action in Problem Management State Transition Modals.
The buttons exist, and if I change the view of the problem, the buttons are displayed. They are not displayed on pop-up.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-01-2022 09:22 AM
Hi,
Did you try the solution which I have proposed. step by step solution I have given below.
Let me know if you are facing an issue. Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-31-2021 03:29 AM
Hi,
Please follow the steps below to achieve your requirement:
1) Modify your Resolve UI Action on Problem Table with Script as below:
function onResolve() {
var tableName = 'problem';
var number = g_form.getValue('number'); // sys_id of the record you want to show
//Create and open the dialog form
var gdw = new GlideDialogWindow("renderProblem");
gdw.setTitle("Resolve Problem Record");
gdw.setPreference('tableName', 'Problem');
gdw.setPreference('prbID', number);
gdw.render();
}
2) Now once this is done, create a new UI Page named "renderProblem" which is same as referred to in UI Action above:
HTML:
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:evaluate var="jvar_v1" jelly="true" expression="RP.getWindowProperties().get('tableName')" />
<g:evaluate var="jvar_v2" jelly="true" expression="RP.getWindowProperties().get('prbID')" />
<TABLE BORDER="0" width="600">
<TR>
<TD>
<span id="var1">${jvar_v1}</span>
</TD>
<TD>
<span id="var2">${jvar_v2}</span>
</TD>
</TR>
<TR>
<TD>
Below button are used to Resolve the Problem Record
</TD>
</TR>
<TR>
<TD align="right">
<!-- Include the 'dialog_buttons_ok_cancel' UI macro -->
<button type="button" onclick="OK()">OK</button>
<button type="button" onclick="Cancel()">Cancel</button>
</TD>
</TR>
</TABLE>
</j:jelly>
Client:
function OK(){
var getPRBID = g_form.getUniqueValue();
g_form.setValue('state',106);
GlideDialogWindow.get().destroy();
}
UI Page Screenshot:
Output:
This displays the button correctly and on click of OK it makes the problem as Resolved as well.
Hope this helps. Please mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2022 04:29 AM
Hi Shloke,
Your solution is working.
But I wanted to used the OOB views.
Thanks,
Adina