SmartObject List View validation compaing values on the same row

  • 16 April 2014
  • 3 replies
  • 0 views

Badge +1

Hi,

 

I have a list view. One the list view I have columns "Qty Being Claimed" and "Qty Available". I want to highlight "Qty Being Claimed" and throw a valdation error for rows where "Qty Being Claimed" is greater than "Qty Available" as well as disable the Submit button. I will be adding this view to a Form. Where should I set the rules to do this and how? Thanks  in advance!


3 replies

Badge +7

If I'm not mistaken, you want to create the validation on a form that submits to your List view.  If so, then you can compare the Qty Claimed box to the Qty Available.  What I would do is start off with the submit button disabled, and enable it if they meet your conditions.  If they do it wrong...have a warning lable hidden that displays if the wrong data is entered:

16417i76FBDD22970DB3EA.png

Under this situation, my submit button wouldn't enable unless Qty Available was greater than Claimed.

 

You could also put a warning on the view that states the condition pior to them entering the data and just not enable the button until they enter it correctly.

 

Good luck

Badge +1

Hi David,

 

Thank you very much for the reply. My problem is that I'm using a list view so I need the same rule to run on every row in the list and it seems like they way to do that is not similar to how it would be done for a cases without lists/rows. :(

 

Thank you!

Userlevel 4
Badge +13

Hi Sharkee


 


You want to compare the one value against the other value but this must be done with each record in the list view, this boiles down to - trying to select all or multiple records in a list view to be able to perform a singe action on all of them at once.


 


In a list view per design this cannot be done, as smartforms is designed to let the user select a single record at a time and do certain actions on this item and then carry on to the next selected item.


 


You can however create a button/toolbar button in the list view and hook up the this rule construction:


 


When Validate button is clicked


If an advanced condition is true                                  Advanced condition being "Test1 less than Test 2"


then show a message to the user (configure)          Validation Passed


Else


then show a message to the user (Configure)         Validation Failed


 


This would the validate the selected record and you can carry ou this action through the entire List view (Note I did not add the disable submit button). But then again this will be very time consuming if you have a huge list view and will then only work if the validate button is click, so if the button is never click then the view is never validated with this validation, which acording to me is a little useless for what you want to achieve.


 


You can log a K2 support ticket to request this as a feature if you realy feel that, there is no other way of achieving this.

Reply