how to stop passing 'special instructions' value to before sc task activity in workflow

raj765_32
Tera Contributor

hi can anyone help me with scenario for 

when i submit a catalog item there are three sc tasks in where i have written a code in 2 and 3 rd sc task to display some value in special instructions field.

 

What happening is that after i close complete 1 st sc task, the data/value written in  2 and 3 sc task is getting displayed when 1 st sc task is closed complete. 
please help me how to fix this and where to fix this in which sc task.

below is the code :
i have written this code in workflow 2nd and 3rd  catalog task activity

var gr = new GlideRecord('sc_request');
gr.addQuery('sys_id', current.request);
gr.query();
 
if(gr.next())
{
gr.special_instructions = "1. Complete template to request EP End User Access form Blue Yonder. \n\n2. Submit request (Medium priority) via Blue Yonder portal.";
gr.update();
}

my requirment is that special instructions value should not display in 1 st sc task when the task is completed  and what ever state it should display in 2 and 3 rd sc task only
1 ACCEPTED SOLUTION

So I added the line in the catalog task and it was updated in the tasks.

u_special_instructions = 

Dhanashree1_1-1714203336251.png

 

and it was updated in the task. It was not updated in the 1st one as per your requirement. If you have created the field check the name of the field that you have created. 

 

Dhanashree1_0-1714203083091.png

 

View solution in original post

12 REPLIES 12

Community Alums
Not applicable

Hi @raj765_32 ,

I think in your code you are not closing the string in while loop, when you updating the gr.

var gr = new GlideRecord('sc_request');
gr.addQuery('sys_id', current.request);
gr.query();
 
if(gr.next())
{
gr.special_instructions = "1. Complete template to request EP End User Access form Blue Yonder. \n\n2. Submit request (Medium priority) via Blue Yonder portal. "// You are not closing this string.
gr.update();
}
 
Can you please check it now 
 
Please mark my answer correct and helpful if this works for you
 
Thanks and Regards 
Sarthak

Hi 

the code is same from the above can i know where did you closed the loop?

please see the code above i have given the same

Brad Bowman
Kilo Patron
Kilo Patron

Your code updates a field on the REQ (sc_request) record, so that will display on any/all sc_task records if this field from sc_request is added to the sc_task form.  It would be best to update a field on the sc_task record if you only want it viewable on certain sc_tasks.