The class provides access to the meta data of a system object or custom
object. A short example should suffice to demonstrate how this metadata can
be used in a script:
1var co : CustomObject = CustomObjectMgr.getCustomObject("sample", "MyCustomObject");23// get the object type definition4var typeDef : ObjectTypeDefinition = co.describe();5// get the custom object attribute definition for name "enumIntValue"6var attrDef : ObjectAttributeDefinition = typeDef.getCustomAttributeDefinition( "enumIntValue" );7// get the collection of object attribute value definitions8var valueDefs : Collection = attrDef.getValues();910// return function if there are no object attribute value definitions11if(valueDefs.isEmpty())12{13 return;14}1516var displayValue : String;17// loop over object attribute value definitions collection18for each ( var valueDef : ObjectAttributeValueDefinition in valueDefs )19{20 if( valueDef.getValue() == co.custom.intValue )21 {22 displayValue = valueDef.getDisplayValue();23 break;24 }25}
Returns a collection of all declared attributes for the object.
The collection contains both system and custom attributes. There might
be system and custom attribute with identical names. So the name of the
attribute is not a uniqueness criteria. Additional the isCustom() flag
must be checked.
Returns a collection of all declared attribute groups. A attribute group
is a collection of attribute, which are typically displayed together as
a visual group.
Returns a collection of all declared attributes for the object.
The collection contains both system and custom attributes. There might
be system and custom attribute with identical names. So the name of the
attribute is not a uniqueness criteria. Additional the isCustom() flag
must be checked.
Returns:
a collection of all declared attributes for the object.
Returns a collection of all declared attribute groups. A attribute group
is a collection of attribute, which are typically displayed together as
a visual group.
Returns the system attribute definition with the given name. The method
returns null if no system attribute is defined with that name. Only
system objects have system attributes. A CustomObject has no system attributes
and so the method will always return null for a CustomObject.
Parameters:
name - The unique name of the custom attribute definition within the object type.
Returns:
The matching attribute definition or null in
case no such definition exists.