How to show Variable only in one SCTASK.

ND7
Kilo Sage

Dear Experts,

My requirement is I have a variable that is required to be Mandatory, shown only in one task. 

 

if SCTASK short description is Please add Price then show the variable mandatory.. show only in one CATALOG TASK where the short description is please add price.   THANK YOU MUCH APPRCIATED. 

find_real_file.png

 

 

find_real_file.png

1 ACCEPTED SOLUTION

Allen Andreas
Administrator
Administrator

Hello,

In your workflow or flow for this catalog item, you specify the variables that should be included. Simply only include this variable on the appropriate task, leave it off the others. Use a UI Policy on the catalog item itself to make it mandatory on catalog tasks.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

6 REPLIES 6

Dan H
Tera Guru

Hi,

You can use the following approach:

OnChange client script running on the Catalog Task's short description field.

When the short description changes, it will evaluate the contents, if it contains Please add price, then field will be set as mandatory.

find_real_file.png

Script:

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
   if (isLoading || newValue === '') {
      return;
   }

	
	if(newValue.toLowerCase().includes('please add price')){
		g_form.setMandatory('u_price_amount', true);
	}else{
			g_form.setMandatory('u_price_amount', false);
		}
	}

Hope this helps.

Please mark my answer as Correct/Helpful based on impact

Regards,

Dan H

Very helpful, thank you

Allen Andreas
Administrator
Administrator

Hello,

In your workflow or flow for this catalog item, you specify the variables that should be included. Simply only include this variable on the appropriate task, leave it off the others. Use a UI Policy on the catalog item itself to make it mandatory on catalog tasks.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Simple idea and it worked Thank you