Lets suppose you have a order header with line item parts. You want to have a rule that says that at least one line item (part item to order) has to exist on the order to save the order (an order header with no line items is not valid). What is the best way to implement a business rule for this? Puting the rule on the parent turns the whole grid of line items red. Puting the rule on the child collection doesn't seem to work when the collection is empty.
The rule must be on the parent object but you could
A: create a "message" field and attach the rule to that field rather than the child collection or
B: create an object level rule.
A will allow you to create a "message" field and show the error in a nicer way. Option B will have to be coded by yourself as PropertyStatus does not support object level rules.
Copyright (c) Marimer LLC