I am creating an order form for employees to order supplies. We have a SQL table listing authorized supplies and the maximum they are allowed to order. I have a lookup for column 1 = item name, column 2 = max allowed. The employee only has to fill out column 3 with the amount ordered. I am trying to EITHER make it impossible for them to choose a value higher than column 2 for that row, OR change the color of the row to make it easier for the approver to identify when they've ordered too many supplies. Thanks for any help!
Question
Question
Replies
As far as I know there is no method to pass in dynamic values (tokens) for max and min values of a number field. It would be cool if we could. I believe the only way to get what you want is with JavaScript. Maybe with built-in open functions and an extra column, but JS would give you the most versatility.
Here is another post where someone wants very similar solution
https://answers.laserfiche.com/questions/181697/Max-Value--in-table#181819
pseudo logic /code
1. onlookupComplete or onlookupfinished
2. Call function "Find Max possible value"
Find Max possible value function:
1. for each "Class name of table you prefilled and now left with column 3 for user input"
2. set variable currentRowMaxValue = $(this).find("class name of your column that holds the max value of what column 3 can be").val()
3. if ( $(this).find("Name of column 3 for user input).val() > currentRowMaxValue)
A. Call function to show that you got error
Below is links for you help understand this