How to get pop up in ITSM Application

Steveanner
Tera Contributor

Hello Community Folks,

@Ankur Bawiskar 

We are using ITSM Applications and we are looking for  pop up window when user click the resolve button

it should display below fields in pop up window 

1.Resloution code(Drop down values also should come)

2.Resulution notes

Note : when popup open we should mandate both fields values if anyone click ok without entering values it should populate error message and also we are looking to include this code in resolve button without breaking existing functionality

We are not experts to achive this can anyone help with code to sort out this it would be appreciated

 

Thanks,

Steve An

1 ACCEPTED SOLUTION

@Steveanner 

here is the sample on how to show choice and update

enhance as per your need

UI Page Name: show_resolution_code_notes

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:ui_form>
		<g:evaluate var="jvar_sysid"
					expression="RP.getWindowProperties().sysid"/> 
		<table border="0" width="100%">
			<tr>
				<td>
					<g:ui_multiline_input_field name="resolution_notes" label="Resolution Notes" mandatory="true" />
				</td>
			</tr>
			<tr>
				<td>
					<g:ui_choice_input_field id="resolution_code" name="resolution_code" label="Resolution Code" onChange="populateChoices()">
						<option value="none">${gs.getMessage('--None--')}</option> 
						<option value="Solved (Work Around)">Solved (Work Around)</option> 
						<option value="Solved (Permanently)">Solved (Permanently)</option> 
					</g:ui_choice_input_field>
				</td>
			</tr>
			<tr>
				<td>
					<g:dialog_buttons_ok_cancel cancel="return onCancel();" ok="return onSubmit();"/>
					<input type="hidden" id="task_sys_id" name="task_sys_id" value="${jvar_sysid}"/>
				</td>
			</tr>
		</table>
	</g:ui_form>
</j:jelly>

Client Script:

function onCancel() {
	GlideDialogWindow.get().destroy();
	return false;
} 

function onSubmit() {

	var data = gel('resolution_notes').value;
	var dropdown = document.getElementById("resolution_code");
	var closeCodeValue = dropdown.options[dropdown.selectedIndex].value;

	var sysId = gel('task_sys_id');
	var app = new GlideRecord("incident");
	if(app.get(sysId)){
		app.close_code = data;
		app.close_code = closeCodeValue;
		app.update();
	}
	window.open('/incident.do?sys_id='+sysId);
}

UI Action:

1) Client checkbox - true

2) Onclick -  confirmAction()

function confirmAction() {

	var dialog = new GlideDialogWindow('show_resolution_code_notes');
	dialog.setTitle('Resolve');
	dialog.setPreference('sysid', g_form.getUniqueValue());
	dialog.render();
}

Output:

If my response helped you please mark it correct to close the question so that it benefits future readers as well.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

20 REPLIES 20

Thanks for the code ankur,

But when we click the UI action it's redirecting another tab and receiving record not found message

 

Thanks,

Steve An

Hi,

your ui page name given in UI action must be incorrect.

please share your UI action script screenshot, ui page screenshot

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Below are the snapsfind_real_file.png

find_real_file.png

 

 

@Steveanner 

Could you please check this question of yours

How to call the property

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Steveanner 

when you click Try It on that UI page it shows fine?

Also can you share the ui page name screenshot

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader