condition visibility for specific users connected

Hi,

i need to give visibility of some filed in format design of interaction (ess.sd.open)

the list of  the specific users belongs to specific assignement groups which start by "DR".

i tired to put this condtion like this : [assignements] #"DR" but it does not work.

how can i configure this condition visibility ?

regards.

Parents
  • Using [assignments] in a Dynamic View Dependency condition tells the system to check the value in the 'assignments' field on the currently loaded record to determine whether or not to do something.  Since you're not looking to compare against the values in the loaded record, but values in the operator's record you can't do it like that.

    Instead, you've got to create a variable that gets populated when the user logs in, and use that variable to set the visibility condition.

    When a user logs in, the system stores all the groups they belong to in an array variable called $lo.pm.assignments.  This holds an array of all the groups the currently logged in operator belongs to.

    So, here's how I'd solve this.

    In the login.DEFAULT formatctrl on the Javascript tab, add something like the following:

    var isDR
    var assignment = new SCFile("assignment");
    var getAssignment = assignment.doSelect("name#\"DR\"");
    while (getAssignment == RC_SUCCESS && isDR == null){
        if (system.functions.index(assignment.name, vars.$lo_pm_assignments)>0){
            isDR=true;
        }
        else {
            getAssignment = assignment.getNext();
        }
    }

    if (isDR==true){
        vars.$lo_dr = true;
    }
    else {
        vars.$lo_dr = false;
    }

     

    Then, in your DVD condition, use [$lo.dr] as your condition, and that _should_ work.

    The only thing I'm unsure of is that you're using the ess forms, and I'm not sure those users really have regular log ins and operator records.

Reply
  • Using [assignments] in a Dynamic View Dependency condition tells the system to check the value in the 'assignments' field on the currently loaded record to determine whether or not to do something.  Since you're not looking to compare against the values in the loaded record, but values in the operator's record you can't do it like that.

    Instead, you've got to create a variable that gets populated when the user logs in, and use that variable to set the visibility condition.

    When a user logs in, the system stores all the groups they belong to in an array variable called $lo.pm.assignments.  This holds an array of all the groups the currently logged in operator belongs to.

    So, here's how I'd solve this.

    In the login.DEFAULT formatctrl on the Javascript tab, add something like the following:

    var isDR
    var assignment = new SCFile("assignment");
    var getAssignment = assignment.doSelect("name#\"DR\"");
    while (getAssignment == RC_SUCCESS && isDR == null){
        if (system.functions.index(assignment.name, vars.$lo_pm_assignments)>0){
            isDR=true;
        }
        else {
            getAssignment = assignment.getNext();
        }
    }

    if (isDR==true){
        vars.$lo_dr = true;
    }
    else {
        vars.$lo_dr = false;
    }

     

    Then, in your DVD condition, use [$lo.dr] as your condition, and that _should_ work.

    The only thing I'm unsure of is that you're using the ess forms, and I'm not sure those users really have regular log ins and operator records.

Children
No Data