Tuesday, May 17, 2011

Scriptless Solution: Close SR only if all activities are closed

Requirement: The user should be allowed to closed a Service Request only if all activities for the SR are closed. If any activity is in Open status then user cannot close that SR and a error should be displayed.

This can be done without scripting by using Runtime Events and DVM Rules.


Step1: Create a DVM Rule
Create a DVM Rule by navigating to Administration- DataValidation Screen
  • Create a Validation Message with below values.
    • Message Code: TEST-1101
    • Message Level: Service Request
    • Message Source: Action
    • Message Text: Please close all activities first.
  • Create a DVM Rule with following values.
    • Name: SR Activities Validation
    • Business Component: Service Request
  • In Rules Applet, Create a Rule with following values.
    • Sequence: 1
    • Name: Check All Activities
    • Expression: NOT(BCHasRows ("Service Request", "Action", "[Activity SR Id]='"+[Id]+"' AND [Status]<>'Closed'", "All"))
    • Business Component: Service Request
    • Apply To: Current Record
    • Retun Code: TEST-1101
    • Immediate Display: True (in Rule Detail Applet)
  • Activate the Rule by clicking Activate Button.
Step 2: Create Runtime Event
Create a Action Set by navigating to Administation- RuntimeEvents Screen.
  • Create an Action set with below values
    • Name: Validate SR Activities
    • Action Type: BusService
    • Conditional Expression: [Status]='Closed'
    • Business Service Name: Data Validation Manager
    • Business Service Method: Validate
    • Business Service Context: "Rule Set Name", "<DVM Rule Created in Step1>", "Enable Log", "Y"
  • Create a Event with following values
    • Sequence:1
    • Object Type: BusComp
    • Object Name:Service Request
    • Event: PreWriteRecord
    • Action Set Name: Validate SR Activities
  • Reload Runtime Events.
In Application go to Service Requests and Test the DVM Rule. It will throw error message if we try to close a SR if activities are not closed as shown in below picture.




No comments:

Post a Comment

Siebel Open UI is released ...!!!

Hi Guys, The most awaited feature of Siebel, called Open UI is released. This new feature Open UI is available in new Siebel patch 8.1.1....