function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
nish5nish5 

How to restrict Sum(quantity) of ContractProduct should not exceed Contract Quantity

 I have  Contract Product  as Line  Item . and  want  to restrict Sum (Quantity) of Contract Line Item  should  not exceed  Contract Quantity 
SwethaSwetha (Salesforce Developers) 
HI Nish,
Can you please add more details to the question for clarity. Do you already have a field that calculates "Sum (Quantity) of Contract Line Item"? If so, you can use a validation rule that checks if Contract Quantity is greater than "Sum (Quantity) of Contract Line Item" and shows a message.

More about validation rules: https://help.salesforce.com/articleView?id=fields_defining_field_validation_rules.htm&type=5
 
Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you