I am trying to use dxl to modify object attributes. All is fine for text type attribute but I can not find the syntax for assigning enumeration type attribute. Can someone point me to place when I can find such information or simply write short sample for me. Say, I have attribute name Owner, with possible values being Mark, John, Tom. And I want my script to assign the value of Mark and Tom. |
Re: assigning value(s) to enumerated attribute
From your question I am guessing that you are talking about multi-value enumerated attributes. Object obj = current Object obj."Owner" += "Mark" obj."Owner" += "Tom"
if (isMember(obj."Owner", "Mark")){print "Mark is an owner\n"}
|
Re: assigning value(s) to enumerated attribute Peter_Albert - Fri Oct 23 03:43:44 EDT 2009
From your question I am guessing that you are talking about multi-value enumerated attributes. Object obj = current Object obj."Owner" += "Mark" obj."Owner" += "Tom"
if (isMember(obj."Owner", "Mark")){print "Mark is an owner\n"}
sarfrazm |
Re: assigning value(s) to enumerated attribute sarfrazm - Fri Feb 12 13:26:00 EST 2010
For normal enumerations the comparison would be same as for a text type attribute:
if (o."Attribute Name" "" == "Enumeration Value")
{
// do stuff
}
|
Re: assigning value(s) to enumerated attribute SystemAdmin - Fri Feb 12 15:14:45 EST 2010
For normal enumerations the comparison would be same as for a text type attribute:
if (o."Attribute Name" "" == "Enumeration Value")
{
// do stuff
}
if(probeAttr_(object,"Attribute Name") != "Enumeration Name") { // body of if statement } This works for me. And I got the idea from your suggestion. Thanks for solving my problem! sarfrazm |
Re: assigning value(s) to enumerated attribute sarfrazm - Tue Feb 16 09:37:44 EST 2010 I'd like to develop a layout DXL that compares the related numbers of the object's selected enum values and compare them against another single-select enum's related value for the same object, display text such as "Valid" or "Not valid". Example: "MasterEnum" is a single select enum (Values=Red/Blue/Yellow/Orange (related values 1/2/3/4 respectively) "SecondaryEnum" is a multi-select enum with 15 possible values "A", "B", etc with related 1-15 respectively. My layout column should indicate the following: SecondaryEnum MasterEnum Display (Reason) A,C Orange "Valid" Both 1 and 3 (A/C resp values) < 4 (Orange) A,C,F Orange "Invalid" 6 (F) not < 4 (Orange) <null> Red "Valid" no value for null string < 1 (Red) |