Make subject person empty based on a field value on HR case table

rambo1
Tera Guru

Hi Team,

 

I am using a record producer to create record in HR core case table.

Record producer has a field called external employee, if this is checked as true then when case is created subject person field should be empty.

If external employee field is false, then HR case can have subject person.

I have used record producer script to clear subject person value based on external field but it did not work.

Any other way ?

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

@rambo1 

please try to use after insert BR on that case table

please share your existing record producer script which you wrote.

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

new sn_hr_core.hr_ServicesUtil(current, gs).createCaseFromProducer(producer, cat_item.sys_id);
if(producer.ex == 'Yes')
{
    current.subject_person = '';
}
Above is the script I am using, is there any other way instead of BR. Please suggest.

@rambo1 

script looks good.

did you check it went inside that IF?

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

Yes , I am have added info log and I am able to see it.

But still subject person on HR form is populated.