You need to sign in to do that
Don't have an account?

Products and opportunities
I have a following business requirement.
We are using products to capture different products that our company offers.
On an opportunity we use a lookup to product to select the product that is bought.
My challege is that there is a total amount on the product that can be sold (total_amount__c), whenever an opportunity is created against a product I want the total amount to reflect
Total amount - Oppty amount
and show the message to the user if the total product amount is less than 0
Can someone point me in right direction please. If someone can provide trigger code and the test class I would greatly appreciate.
Thanks
Amount > Total_Amount__c
The validation rule will cause the user to get an error if they go over their allocated amount.