5 Replies Latest reply on Jan 23, 2013 4:49 PM by ChewCheeLim

    Can not edit Attribute description property.

    ChewCheeLim

      Hi, There: I receive this error sporadically.. it looks to me, sometimes, I can change attribute description, at other time, I received this error. I tried to look at the AF DB to see if I can see things that didn't set properly in PI System explorer.. but I am not able to identify any.

       

      Does anyone have this issue before? how to fix it?

       

       

       

       

       

      Cannot change the 'Description' property of Attribute 'ScanClass' in Element 'InBrk002' in Element 'In' in Element 'GroupA' in Element 'EMGroups' in Element 'emInfrastructure' in Element 'Site1' in Element 'USA' in Element 'MBDC4' because it is defined by its template.

       

       

        • Re: Can not edit Attribute description property.
          Rick Davin

          If the attribute is based on an attribute template, you can't change the description for that attribute.  But you can change the description on the attribute template.  And you can change the description of an attribute that isn't based on a template.

            • Re: Can not edit Attribute description property.
              ChewCheeLim

              Thanks Rick for your quick response. If I created an Element based off AFElementTemplate like so:

               

              Elements.Add("TEST", oTemplate);

               

              Correct to say that the attributes created is based on attribute template?  Then all descriptions are editable?

               

              How can I tell from PI System Explorer that this attribute is created based on attribute template? and also to know editable vs. non-editable on description field?

                • Re: Can not edit Attribute description property.
                  Rick Davin

                  In your example of adding an element based on an element template, then yes all of its attributes are most likely based on an attribute template.  In fact, to add attributes not based on a template to an element based on an element template, you would need to explicitly declare that the element template will 'Allow Extensions'.  Are all the descriptions editable?  For the attribute template, they are. For the attribute, they aren't.

                   

                  How can PSE visually tell you that the attribute is based on a template?  Look for the small green T.

                   

                  0842.PSE-Green-T-for-Template.png

                   

                  Visually, the description field will be slightly grayed or dimmed, indicating that you can't edit the field.  If the back color is white, then you can edit it (assuming you have edit permissions to the objects in that database).

                   

                  But wait, there's more!  Though you didn't ask about the AFSDK, you did have a snippet of code.  So the SDK can tell you if the attribute is based on a template by checking the Attribute.Template property.  If the .Template is null (nothing in VB), the attribute is not based on a template and the description is therefore editable.  If .Template is not null, then the attribute is based on a template and its description is not editable.

                    • Re: Can not edit Attribute description property.
                      mhamel

                      @Chew Chee: When you navigate in the Attributes tab, you will see a column containing an icon with a T letter within a green square. If you see one next to your attribute, this one derives from a template. Another way would consist of using the group by option. In the upper right corner of the Palette section (this is where you navigate for your element, attribute, and version properties), you will find the option to group you attributes by category or template. If you picked the template option, you will find the ones deriving from one or many templates. Knowing if it is editable or not can be done by clicking on the attribute and see if the Name, Description, Categories, etc. are greyed out.

                       

                       To answer your other question, you need to specify within your template that this setting is not read-only. You will see the mention ReadOnly=False; in the configstring property of your attribute.