Print

IsUniqueValue

This function checks if specified fields value is unique across some or all cases.

Syntax

IsUniqueValue("field","filter");
IsUniqueValue("field","filter","closedCasesAswell");

Function arguments

  • field – (String) The name of the field containing value that is to be checked if is unique.
  • filter – (String) Filter value specyfing which cases are to be searched through. Available values: [ User | Organization | Database ]
    Filter values explanation:
    User – check through all cases created by current user
    Organization – check through all cases created by anyone from the current user’s organization
    Database – check through all cases
  • closedCasesAswell – (Boolean) [Optional] Specify if search is to be performed only in open cases (default behaviour) or in closed cases aswell. (Default = false)

Return value

This function returns Boolean.
Returns true if specified field’s value is unique, false otherwise.

Examples

Example 1:
This will check if 'Phone Number’ field’s value is unique across all opened cases created by anyone from current user’s organiztaion.

isUnique = IsUniqueValue("Phone Number","Organization");

Example 2:
This will check if „Activity” field’s value is unique across all opened cases created by current user and if not, show appropriate message.

if(IsUniqueValue("Activity", "User") == false) {
ShowMessage(1, "Identical Activity already specified elsewhere.");
}

Example 3:
This will check if 'Country’ field’s value is unique across all cases, both in opened and closed cases.

IsUniqueValue("Country", "Database", true);
Czy artykuł był pomocny?
0 na 5 gwiazdek
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5
How can we improve this article?
How Can We Improve This Article?