Limit enumeration values available for an operator

salvdangelo

15-04-2019

Hello,

I was wondering how is it possible to limit the visibility of the enumeration values in an enumeration E according to one condition specified in an input form (for example current operator group, or one named right the operator owns)

Example:
ENUM E: A,B,C,D

OPERATOR GROUP "OpA" --> Field myValue using ENUM E : dropdown list will show values A,B,C

OPERATOR GROUP "OpB" --> Field myValue using ENUM E : dropdown list will show values B,D

...

Could you tell me how is it possible to do that inside an input form ?

Thanks in advance,
Salvatore

Jean-Serge Biron

wodnicki

pablo.rosero

Amit_Kumar

davidk23955130

Amy_Wong

Adobe Campaign Classic

Accepted Solutions (1)

Accepted Solutions (1)

geoffreyl240454

15-04-2019

Hi salvdangelo​,

It's possible to do that with this steps:

- Creation of a relation table between the Operators and the Enumeration Values tables (N-N), this table will contains the operatorId and the enumValueId (same principle than between the recipients and the recipients lists).

- Linking the Operators and the Enumeration Values tables with the new relation table.

- Adding a "sysFilter" in the input defined in the input form:

<sysFilter>

     <condition expr="[enumValueOperatorRel/@operator-id] = $(@operator-id)"/>

</sysFilter>

Best Regards.

Geoffrey.

Answers (7)

Answers (7)

geoffreyl240454

06-08-2019

Hi salvdangelo​, yashdeepm7845047​, arpandas681683​,

I found a way to filtering very easily the values of an enumeration coming from a schema. In fact, you have just to add a "enabledIf" attribute with a "HasNamedRight('myRightName')":

<enumeration basetype="string" default="A" name="example">

     <value enabledIf="HasNamedRight('OpA')" label="A" name="A" value="A"/>

     <value enabledIf="HasNamedRight('OpA') or HasNamedRight('OpB')" label="B" name="B" value="B"/>

     <value enabledIf="HasNamedRight('OpA')" label="C" name="C" value="C"/>

     <value enabledIf="HasNamedRight('OpB')" label="D" name="D" value="D"/>

</enumeration>

The named right can be applied on an operator or a group.

Please note that an administrator can see all the values even if he haven't the good right.

Regards,

Geoffrey.

wodnicki

MVP

07-05-2019

Hi,

You can do this with schema sysfilters and joins. Sysfilter you're conditionally appending predicates to the where clause, usually current operator has a right or is admin. I'm not sure how dbEnums behave with schema sysfilters tacked on (to xtk:enum), but sounds like something that should work.

Thanks,

-Jon

geoffreyl240454

07-05-2019

Hi yashdeepm7845047​,

The principle works with the enumeration values but I unfortunately did not found a way to apply this to the enumerations from schemas.

It is possible to create two enumerations in the schema and call the good one in the form depending on the operator but this solution means that we have two different fields in the database and I think it's not really clean.

Thanks,

Geoffrey.

yashdeepm784504

06-05-2019

Hi geoffreyl24045476​ and salvdangelo

Can we do same configuration at Schema level ?

ENUM Frequency : dropdown list will show values Daily, Weekly, Monthly for operator 1

ENUM Frequency : dropdown list will show values Daily, Weekly for operator 2

Thanks,

Yashdeep

geoffreyl240454

19-04-2019

Hello Abdul,

It's more complicated to do that with the groups.

Indeed, an operator can be linked to many groups so it's difficult to set the "sysFilter" tag.

If it's possible, I don't know how. Sorry to can't help more.

Best Regards,

Geoffrey.

AbdulZa

18-04-2019

Can this be done on an operator group level? the goal here not to update the relationship table every time a new operator/user is being created/added to the system.