Validation on MRVS

Brijmohan
Tera Contributor

Hi, I have one requirement in mrvs, If we will open existing record then cost center field will be read only but if we add new row then it should be editable. is this possible, if yes please help me with approach. PFB snap of mrvs.

 

Brijmohan_0-1724784531383.png

Thanks,

Brijmohan

1 ACCEPTED SOLUTION

That's what I was saying would happen with a UI Policy, so if you want to allow changes before the row is added, use an onLoad Catalog Client Script instead, and make sure there are no onChange client scripts or UI Policies affecting this variable.

View solution in original post

4 REPLIES 4

Brad Bowman
Kilo Patron
Kilo Patron

It seems like with only these two variables in the MRVS that Cost center should be mandatory.  Is there a use case that someone would add or edit a row with a blank cost center?  If this is a good assumption, go ahead and make that variable mandatory, and then all you would need in an onLoad Catalog Client Script that applies to the MRVS, or a Catalog UI Policy is if cost center is not empty then it's read only. 

 

With the standard recommendation of using a UI Policy for this, once the variable is populated it will become read-only, so no room for error.  With a client script it will not become read only until the row is first added, then attempting to be edited.

Hi @Brad Bowman , Thanks for your response, If i will go with this approach then it will make Cost center variable read only next moment when we fill any value in cost center variable. If user wants to remove the recent selection and change the value then in that case it is not possible. Is there any way to restrict it, so it will not make read only field until user click on the add button?

 

Brijmohan_0-1724844986472.png

Thanks,

Brijmohan

That's what I was saying would happen with a UI Policy, so if you want to allow changes before the row is added, use an onLoad Catalog Client Script instead, and make sure there are no onChange client scripts or UI Policies affecting this variable.

Hi @Brad Bowman  , Thanks for your help! It's working with client script.