Hello,
I've noticed that coding using custom attribute types can be a little tricky for different reasons:
- Even thoug they suppose to be static, I've noticed custom attribute type numbers can change over time for different reasons. This has a direct impact on you code.
- You have to keep those numbers defined as global variables in your code and keep them updated.
- When you are working on the scripting module, you always have to switch to Admin module in order to know the custom attribute type number.
- This same problem happens with custom object or model types.
Can anyone out there explain what is the best way to work with this kind of attributes?
Best regards
Cezmi Eroglu on
Hello Fernando,
Best method to work with user-defined attributes is to use the GUIDs which are unique and constant. Here is an example for macros:
var metamodel = Context.getArisMethod(); var attRef = metamodel.UserDefinedAttributeTypeNum("67e9d210-748a-11df-76b7-003005a85e34");Basicly, you get the attribute type number by GUID. Hope this helps.
Best Regards,
hvar metamodel = Context.getArisMethod(); var targetObj=Constants.ST_OBJECT_1; var attRef = metamodel.UserDefinedAttributeTypeNum("67e9d210-748a-11df-76b7-003005a85e34");Cezmi