Info MessageAt least one of flow, workflow or execution plan should be filled. Otherwise, when order is placed, then even on approving request, the stages of requested item won't be updated.

Rajendher1
Tera Expert

Hello Team,

Can anyone elaborate on this?

 

find_real_file.png

I have not filled up both workflow and execution plan as I am using BR to generate SCTasks based on a MRVS rows. Is it mandatory to fill in these?

 

find_real_file.png

 

 

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you can use onSubmit client script and check at least 1 is selected or not

regards
Ankur

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

Hi,

something like this as onSubmit on catalog item table

function onSubmit() {

	var value1 = g_form.getValue('flow_designer_flow');
	var value2 = g_form.getValue('workflow');
	var value3 = g_form.getValue('delivery_plan');

	if(!value1 && !value2 && !value3) {
		g_form.addErrorMessage("Please select at least 1 field");
		return false;
	}
	return true;

}

regards
Ankur

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

Hello Ankur,

my question is that how can I overcome this inbuilt issue by not selecting either flow, workflow, execution plan?

Since I should not select either of these to generate SCTasks based on variable selection. If selected, execution plan by default two sctasks per ritm generated?

How could I proceed further?

find_real_file.png

I am using After BR on insert, on RITM table 

(function executeRule(current, previous /*null when async*/ ) {


var mrvs = current.variables.<mrvs_variableset>; //accessing MRVS
var rowCount = mrvs.getRowCount(); //gets row count

for (var i = 0; i < rowCount; i++) {
var sctask = new GlideRecord('sc_task');
sctask.initialize();
sctask.request_item = current.getUniqueValue();
sctask.setValue('sctask', current.getUniqueValue());
sctask.setValue('short_description', mrvs.getRow(i).<variable1>); //mapping short description
var intface = mrvs.getRow(i).getCell('<var2>').getCellDisplayValue();
if (intface === 'Other') {
sctask.setValue('description', 'var2:' +mrvs.getRow(i).var3); //interface values are mapped
} else {
sctask.setValue('description', 'var2:' +mrvs.getRow(i).var2);
}
sctask.insert(); //creates SCTasks
}
})(current, previous);