Demand - Set Default Preference to Close Demand on Closure of Project

Kevin21
Tera Contributor

I would like to set the Default behavior for Demand that are Projects to close the Demand On Closure of project, buit there seems to be javascript there and that gives me pause.

find_real_file.png

1 ACCEPTED SOLUTION

Miguel Donayre
ServiceNow Employee
ServiceNow Employee

Hello Kevin,

I understand now. That JavaScript calls a Script Include called DemandUtil that sets the default for Close Demand field. You can change the Default to on_close_project like the picture below . I tested this out and it work, still closes the demand when the project is closed. 

Or you can modify the Script include and set the choice value in there like the Picture below. To replace on_creating_project to this value - on_closing_project. This also works when a Project is closed.

I would change the script IMO.

 

find_real_file.png

 

Before

find_real_file.png

 

After

find_real_file.png

View solution in original post

6 REPLIES 6

Miguel Donayre
ServiceNow Employee
ServiceNow Employee

Hello Kevin,

What do you mean by giving you pause? Are not OK with the JavaScript? IS there is issue / error with the JavaScript?

I don't really know how or what to change in the script and do not want to cause an issue or error

This is the default value space

javascript:DemandUtil.getCloseDemandOption(current);

 

On other forms for default value, it is most times just the choice name that I would place here, but since this one has javascript I didn't want to change it.

Miguel Donayre
ServiceNow Employee
ServiceNow Employee

Hello Kevin,

I understand now. That JavaScript calls a Script Include called DemandUtil that sets the default for Close Demand field. You can change the Default to on_close_project like the picture below . I tested this out and it work, still closes the demand when the project is closed. 

Or you can modify the Script include and set the choice value in there like the Picture below. To replace on_creating_project to this value - on_closing_project. This also works when a Project is closed.

I would change the script IMO.

 

find_real_file.png

 

Before

find_real_file.png

 

After

find_real_file.png

Thank you so much Miguel, worked like a charm!