how to make fields mandatory in Service Operations Workspace in servicenow

shyamsunderl198
Tera Contributor

Form the Service Operation Workspace I am creating a incident.

 

I want to make mandatory  some fields while submitting the incident.

2 ACCEPTED SOLUTIONS

Harshal Aditya
Mega Sage
Mega Sage

Hi,

Are you able to view the fields to be made mandatory on the workspace ?

If not then please add that field on the workspace view of the incident table.

Once visible then you would need to write UI policy to make it mandatory.

 

Please follow the link below if your UI policy does not work

https://www.servicenow.com/community/itsm-forum/ui-policy-not-working-in-agent-workspace-sctask/td-p...

 

If my answer has helped with your question, please mark it as helpful and give it a thumbs up!

Regards,
Harshal

View solution in original post

Rushikesh
Tera Expert

Hello @shyamsunderl198 

 

There are some drawbacks with client script and Ui Policy but you could try the below onLoad client script to achieve your requirement:

Client Script: 

function onLoad() {
//Type appropriate comment here, and begin script below
var url = top.location.href;
alert(url);
if (url.indexOf('sow') == 1) {
alert("in if");
g_form.setMandatory('description', true);
}

}

Below is the screenshot

Rushikesh_0-1677062145870.png

Please mark it as helpful if my answer has helped with your question.

Thank You!!

View solution in original post

2 REPLIES 2

Harshal Aditya
Mega Sage
Mega Sage

Hi,

Are you able to view the fields to be made mandatory on the workspace ?

If not then please add that field on the workspace view of the incident table.

Once visible then you would need to write UI policy to make it mandatory.

 

Please follow the link below if your UI policy does not work

https://www.servicenow.com/community/itsm-forum/ui-policy-not-working-in-agent-workspace-sctask/td-p...

 

If my answer has helped with your question, please mark it as helpful and give it a thumbs up!

Regards,
Harshal

Rushikesh
Tera Expert

Hello @shyamsunderl198 

 

There are some drawbacks with client script and Ui Policy but you could try the below onLoad client script to achieve your requirement:

Client Script: 

function onLoad() {
//Type appropriate comment here, and begin script below
var url = top.location.href;
alert(url);
if (url.indexOf('sow') == 1) {
alert("in if");
g_form.setMandatory('description', true);
}

}

Below is the screenshot

Rushikesh_0-1677062145870.png

Please mark it as helpful if my answer has helped with your question.

Thank You!!