I’m building an employee reward store inside my app. The reward store portion of the application uses three main objects:
- Employee (User object)
- Reward (An object that contains details of the reward including cost, quantity, etc)
- Purchase (A record created to track the order and update the inventory on the Reward object, and point value on the Employee object.
Everything seems to be working correctly, but I seem unable to limit a users ability to purchase an item when they do not have available “points”. (Please note that I am not using an e-comm component). I have been unable to find a way to limit the submit button based on the criteria of available “points” the user has.
Example: User has 5 reward points, and should be unable to “purchase” an item that requires 10 reward points.
Has anyone worked with something similar or have suggestions on how I could either eliminate the form option, or hide the submit or action button?