If requested for and owner field's values don't match then show new variable

Bindhu1
Tera Contributor

Hi Team, could you please assist here:


If the 'requested for' and 'site owner' variable's values don't match, then display a mandatory upload button with 'xyz' text?

here both the variables refers to user table.

 

Thanks

1 ACCEPTED SOLUTION

Hi @Bindhu1 ,

 

Before submitting the catalog item request will not be created so what you can do is You can compare with logged in user  and site owner because Request table Request for hold the logged in user value,

 

I have changed the client script please have a look,

 

function onChange(control, oldValue, newValue, isLoading) {
   if (isLoading || newValue == '') {
	g_form.setDisplay('attachment',false);
      return;
   }

   var requestedFor = g_user.userID;
//    alert('Requested for' + requestedFor);
//    alert('new Value'+ newValue);

   if(requestedFor != newValue){
	g_form.setDisplay('attachment',true);
	g_form.setMandatory('attachment',true);
   }
   else{
	g_form.setMandatory('attachment',false);
	g_form.setDisplay('attachment',false);
	
   }

   //Type appropriate comment here, and begin script below
   
}

 

 

Please mark this comment as Correct Answer/Helpful if it helped you.

Regards,

Swathi Sarang

View solution in original post

12 REPLIES 12

Hello, 

Yes , I want to show the attachment variable on catalog item form and there is no requested for variable in catalog. 

If there is no requested for variable then with what do you want to compare the site owner field?

Hi @SumanthDosapati ,

Kindly look at this image, here 'requested for' field which is editable and it is coming from widget not from item variable.
And those are the cat item variables marked in blue.

Bindhu1_0-1715247946479.png