Get and Set attributes

Build 1501 on 14/Nov/2017  This topic last edited on: 29/Aug/2014, at 13:26

To get an attribute, use the UtilsBase.GetObjAttrValue and supply object id and attribute name:

Dim JHArtAttrib As String = "notes"

Dim artJumpHeadMan = UtilsBase.GetObjAttrValue(Page.GetPageSection, JHArtAttrib)

To set an attribute, use the SetAttribute and supply object attributes, attribute name, and attribute value:

Dim oa As Article = Fred.GetActiveArticle

Dim articleAttributes As IGenericAttrObj

  articleAttributes = oa.Attr

  SetAttribute(articleAttributes, "title", Left(strTitleHead, 255)) 'change the title attribute in memory

  articleAttributes.SaveAttributes() 'save the new attribute into the database