Sunday, February 28, 2010

Scripting alternative –Data Validation Manager

Many times, system requires us to put validations; we generally end up with scripting in Pre Events like PreSetFieldValue or PreWriteRecord.

Recently, I worked on Data Validation Manager which is a quite useful tool to do validations in the application itself without changing the srf. With the combination of Run Time Events, I really found DVM competitive to avoid scripting and from maintenance perspective also.

We can use conditional expression to check the validation and invoke a RTE and DVM.
I will run through the End to End process of creating a RTE and DVM Rule. I will also show you validation getting fired in the application.

Let’s take an example, I want to put a validation that a contact record must have an email address or a Mobile Phone number or a Work Phone number.

To work this validation out, I will do the following steps:- 
  1. Create a DVM Validation Message.
  2. Create a DVM Rule.
  3. Call Data Validation Manager BS using the Action Set.
  4. In the Business Service Context, Provide the DVM Rule name.
  5. Create a RTE.
  6. Reload the RTE and activate the DVM Rule.
  7. Creating a new Contact Record and test the DVM.

I need to create RTE and DVM. It will be a mandatory check for email address or a Mobile Phone number or a Work Phone number. This RTE will be on PreWriteRecord of Contact BC.

Step1: Go to Administration - Data Validation and Create the DVM Message

Step 2: Create DVM Rule for contact validation.

Step 3 and Step 4: Create an Action Set for RTE
Business Service:  Data Validation Manager
Business Service Method:  Validate
Business Service Context:  "Rule Set Name", "Contact Details", "Enable Log", "Y".

Step 5: Create a Run Time Event on PreWriteRecord on Contact BusComp and Call the Action Set created in Step 3 and 4.

Step 6: Reload Run Time Event and Activate DVM Rule.

Step 7: Create a Contact Record and test DVM.
The Limitation of the DVM is that field should be visible on the UI.

Sharing is the Power.

10 comments:

  1. Great post! It's informative and easy to understand.

    Last spring, I posted about using regular expressions with DVM. Take a look: http://siebeldev.blogspot.com/2009/04/regular-expression-validation.html

    Regards,

    Jim

    ReplyDelete
  2. very Useful --Good one.
    Easy to understand .
    Thanks
    -Siebel bee

    ReplyDelete
  3. Hi,
    I'm trying to set the same thing, but I'm invoking the BS in a WF. I have an error saying that it cannot display the message "Unable to load message 0xffff(SBL-GEN-00000)"
    I was trying to look for the log that you setting to "Y" but i couldn't find it anywhere..
    Can you give some help?

    Regards
    PS: The Post and Blog are awesome! :)

    ReplyDelete
    Replies
    1. Even I am getting the same error.. can someone help us here?

      Delete
  4. Hi Ankit,

    It is really good and Informative.

    Thanks,
    Balu

    ReplyDelete
  5. Does DVM work on virtual BC? Am trying to apply a validation rule on the Contact Home Screen

    ReplyDelete
  6. Request somebody to answer unknown questions..

    ReplyDelete
  7. How I can export and import that Validation if I created in test environment and I need use in production environment.

    ReplyDelete
  8. Do data validations work when we import data into an applet?

    ReplyDelete