Create Multiple Task from Record Producer

osni seca
Kilo Expert

I have record producer with two string variables on the form.

Variable A and Variable B

I would like to have two tasks created on the same tables [sn_audit_task] when user submit the request. 

On the Task0001 i would have Variable A populated

On the Task0002 i would have Variable B populated

The script I have does not seems to do the trick

Any help or thoughts and ideas?

 

OS

1 ACCEPTED SOLUTION

Cheers

Will take a look

OS

View solution in original post

8 REPLIES 8

e_17
ServiceNow Employee
ServiceNow Employee

I would create one parent request and then a business rule (on After) that creates the two tasks. the BR can read the variables in the ticket and creates the tasks. 

Utpal Dutta1
Mega Guru

Hey there,

 

Look for your problem you can't code on the Submit button of record producer. I have tried it and failed. So what you can do is create a Macro variable on your Record producer and Create a UI macro. Macro can be a button. Link the macro variable with UI Macro and in UI Macro you can write code to create task on any of your table.

I think this will work. Give it a try!!!

 

If it works then please mark my answer Correct and Helpful.

 

Thanks and Regards:

Utpal Dutta

Something like this button.

 

find_real_file.png

The only problem is you need to code in jelly. If you want to code in JS the you need to use <evaluate> something like below.

 

 

find_real_file.png