validate unique combination of multiple fields

Hi

I'm trying to write a validation rule in custom .Net. On screen, there are three text fields:

I want to write a validation script which will check if the combination of these fields is unique.

However, I'm having trouble figuring out how to do that.

If anyone has any suggestions, I would greatly appreciate it.

Thanks,

  • 0

    Are you validation in the screens? Or validating in the code?

    If you are validating in the screen, then only one of the fields needs to have the definition. In the default system have a look at the casedetailbox and the field case_slaseverity for an example rule that looks at data submitted from two fields.

    If you are writing the rule in code then it will have the structure like this

    public override bool Validate()

    {

    //Always call the base validation method as it checks for required fields

    Boolean ok = base.Validate();

    if (ok)

    {

    //do my validation here!

    //Check values on screen with Dispatch.ContentField("fieldname");

    string name = Dispatch.ContentField("core_name");

    if (name == "aaa")

    {

    ok = false;

    AddError("The name cannot be aaa");

    }

    }

    return ok;

    }