How to disable "Add Row" before its submitted in MRVS?

aryanjain27
Tera Contributor

Hyy All,

 

I am doing a validation when someone adds an item in the MRVS using client catalog script within the variable set not on the catalog item. But if the validation fails, I'd like to block adding this item. Is there a way we can achieve this? I've read posts on removing buttons all together and after they have been submitted but could not find anything related to blocking the Add Row. Or is there a better way to achieve this functionality?

 

Thnx in advance!

 

Screenshot 2025-03-09 145514.png

1 ACCEPTED SOLUTION

Shivalika
Mega Sage

Hello @aryanjain27 

 

You can create "On change client script' in the variable set, where you do the validation on values. If the validation fails please "first clear the values" and then add "error message or alerts." 

 

This will work because when you clear the row values the row is automatically invalid and it has nothing to add. 

 

Please mark my answer as helpful or accept solution if it helped in anyway. 

 

Regards,

Shivalika 

 

LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

YouTube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=C1_aARKZweXTIsx-

View solution in original post

5 REPLIES 5

Najmuddin Mohd
Mega Sage

Hello @aryanjain27 ,
One workaround for this is to create a Mandatory field checkbox, 

When the user checks the checkbox, write an on-change client script to validate the data and if validation failed, make the checkbox to false.

So, this way we can make the user to fill the right information with Check box controlling the functionaity.


If the above information helps you, Kindly mark it as Helpful and Accept the solution.
Regards,
Najmuddin.

Thats a good workaround. I'll look into it. Thnq!

Shivalika
Mega Sage

Hello @aryanjain27 

 

You can create "On change client script' in the variable set, where you do the validation on values. If the validation fails please "first clear the values" and then add "error message or alerts." 

 

This will work because when you clear the row values the row is automatically invalid and it has nothing to add. 

 

Please mark my answer as helpful or accept solution if it helped in anyway. 

 

Regards,

Shivalika 

 

LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

YouTube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=C1_aARKZweXTIsx-

This is a nice sol. I'll look into it. Thnx!