Select the search type
  • Site
  • Web
Search
You are here:  Support/Forums
Support

Bring2mind Forums

Custom Attributes in 5.01.03
Last Post 09/17/2009 1:30 PM by Peter Donker. 2 Replies.
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
GA
New Member
New Member
Posts:40


--
09/14/2009 11:03 PM

Hi,

I have a custom attribute which I have loaded into DMX using the ControlToload. In the code for the control, this is how I try and get the attribute id for this attribute

attList = AttributesController.GetAttributesByPortal(PortalId,

"")For Each attInfo As AttributeInfo In attList.ValuesIf attInfo.Name = "MyCA" Then

attId = attInfo.AttributeId

 

End If

 

 

objEA = EntryAttributesController.GetEntryAttribute(

Next Dim objEA As EntryAttributeInfoMe.CurrentEntry.EntryId, attId, "")

However AttributesController.GetAttributesByPortal(PortalId, "") does not return this custom attribute and so I never get the attributeID. If I execute the stored proc DMX_GetAttributesByPortal with PortalID = 0 and Locale = '', I do see the row for MyCA Custom Attribute. Why is that?

I was using the FindAttributeByName method in the last version but that method does not exist anymore. I do see a FindAttributeByKey method but since there is no way for me through the UI to specify a key for custom attributes when loading them, I cannot use it. I do not want to set the key in the database for each custom attribute I create. How do you recommend getting the attribute or attributeID of a custom attribute in the LoadSettings and WriteToCurrentEntry procedures of the custom attribute?

Also I noticed that the locale is set to "" instead of en-US (which is my default culture), when adding any new folder or attribute to DMX. Is that how it is supposed to be?

 

 

GA
New Member
New Member
Posts:40


--
09/15/2009 10:15 PM
I added a key for the custom attribute manually in the database and now GetAttributesByPortal returns the "MyCA" attribute.

Can you please advise on how a key should be specified for a custom attribute when it is first loaded into the DMX tables. I cannot find any field on the UI.

Or maybe I am doing it all wrong. I will be waiting for your reply on the right way to do this..
Peter Donker
Veteran Member
Veteran Member
Posts:4536


--
09/17/2009 1:30 PM
Hi AG,

You've stumbled on an issue that is not yet resolved. I'm trying to move away from the name of the attribute being used in the logic as was the case in previous versions of DMX. The first part of this was implemented in 5.1 when attributes per folder were set. In this work we moved the 'name' to a field 'key' but overlooked how this plays out in other scenarios. So we need to design a more solid base for passing through the ID of an attribute. The intention is that the AttributeID is used more. The plan is to use AttXX for instance as the identifier in the UI. But some software still needs to use a key to find their own managed attribute. This needs to be resolved and we're working on that for 5.2.
For now you're stuck without the UI bit to edit the key. That needs to be done by hand like you did.

Peter
You are not authorized to post a reply.