Problem Statement: User should not be able to Approve request if there is any activity associated in Open State.
Soln: A little configuration and DVM rule was good enough to run business.
a) Create a MVL in SR bc using with following Values
Name: Open Activity
Destination BC: Action
Destination Link: Service Request/Action
Type Field: Status
Type Value: Open
Compile BC.
b) Navigate to Application - Data Validation. Create a new rule set based on the BO Service Request. Go to Rules Tab. Create a new rule with following values.
Sequence: 1
Name: Open Check
Expression: Count("Open Activity") = 0
Business Component: Service Request
Apply To: Current Record
Return Code:
The key here is the name of the MVL."Count" function is directly used in the evaluation with MVL name. The best part is it doesn't require creation of calculate field in BC. Moreever DVM rules also require field used in expression to be exposed on applet or force active. They truly say everything positive comes with its own inbuilt negativity. But here the direct use of function in DVM comes as relief and also helps in keeping check at performance.
We will discuss more functions and expressions which could be used in the DVM rulesets till then happy commenting.
No comments:
Post a Comment