Hi Community,
I am trying to implement a requirement in the Lead Section where the Product Detail (list) must be mandatory. If the list is empty, the user should be prevented from saving the Lead or moving forward.
I am trying to achieve this via Business Processes/Business Rules.
What I've tried: I attempted a Business Process triggered by a Lead Signal to show a dialogue box/Pre-configured page.
My Questions:
- Is there a way to use Business Rules to validate if a Detail (List) has at least one record?
- Is there a "Pro" no-code workaround to block the "Save" button if the product list is empty?
Any advice on the best architecture for this (DCM vs. Process vs. Hidden Validation Fields) would be greatly appreciated!
Like
Hi Nikita,
If you're trying to enforce this validation while the Lead is still in Add mode (new record), there is an important limitation to consider: the user cannot add records into the Product Detail until the main Lead record has been saved at least once. Because of this, making the detail mandatory on the initial save would prevent the user from ever creating the Lead.
If the requirement is instead tied to a specific stage or status transition, a better approach would be to override the save logic (for example using a crt.SaveRecordRequest handler in Freedom UI) and validate whether the Product Detail contains at least one record before allowing the save or stage movement.
Business Rules themselves cannot directly validate whether a Detail/List contains records. A common approach is:
- Use client-side validation in the save request handler, or
- Maintain a hidden boolean/count field updated via Business Process and validate against that field.