How to prevent 'Subject Person' from defaulting to 'Opened For' in HRSD case creation

Hola Ola
Giga Guru

Hello all,

On the case creation page, when I type in the name of my 'opened for', I am looking to not have that user default to the 'subject person' field. As shown below. 

 

11111.png

 

I have tried to de-activate the 'Auto populate subject person' client script, which hasn't worked:

 

HolaOla_0-1686151032099.png

 

 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
	if (isLoading || newValue === '' || (typeof g_aw !== 'undefined' && g_form.isNewRecord()))
		return;
	var subjectPerson = g_form.getValue("subject_person");
	g_form.getReference('hr_service', setSubjectPerson);

	function setSubjectPerson(serviceGr) {
		var DO_NOT_DEFAULT_SUBJECT_PERSON = '5ad4d1709f402200d9011977677fcfbb';
		if(!subjectPerson && !serviceGr || (serviceGr && String(serviceGr.case_options).indexOf(DO_NOT_DEFAULT_SUBJECT_PERSON)=== -1 )) 
			g_form.setValue("subject_person",g_form.getValue("opened_for"));
	}
}

 

 

 

Any help on this issue will be appreciated.

 

Thank you.

4 REPLIES 4

Saurav11
Kilo Patron
Kilo Patron

Hello,

 

Please check script include:-

 

hr_CaseCreation

 

I think this is from where the subject person is getting populated.

 

Please mark my answer as correct based on Impact.

Max Dore
ServiceNow Employee
ServiceNow Employee

You would not script this. 

On the HR Service record there is a field called "Case options" and there is an option called "Do Not Default Subject Person". Select that for the HR Service(s) that you want to apply it to.

@Max Dore Does not work in the Case Creation page, where the user has to first select the employee (step 1) and then select the service in the next screen (step 2). 

Franchesca Liz1
ServiceNow Employee
ServiceNow Employee

You can achieve this by use of the Case options: "Do not default subject person" and also creating a case creation service config for the HR service and taking out the subject person field on the right task fields. See screenshot below.

FranchescaLiz1_0-1744153267719.png

FranchescaLiz1_1-1744153279823.png