You are trying to lookup the “max value” in a form, that won’t happen naturally due to the sandbox nature of the form.
You have 2 ways to go here:
- First method: For the Product ID choice, create a column in your users table for it, and write to that column instead of the Product ID in your Work Orders table. Then, add a special value in your form to write User Profiles > Product ID to the Work Orders.
This allows you to access the Product ID value whilst still inside the form. From that value, you can create a relation & lookup to retrieve the max value allowed for the quantity.
- Second method: Create a custom form.