Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
Anybody know how to get the valid values for a lookup attribute in a category
Kevin_Goodman
Does anybody know how to get the valid values for a lookup attribute of a category using LAPI (VB preferred but any language would do)?I am able to get the "type", "required", "length", etc values but not the valid values for a lookup attribute. The LAPI documentaion says that you can get the "validvalues" for a popoup attribute, and I have tried this but with no success. I need the "default" or "validvalues" for a lookup item without having to resort to using SQL.I'm using Livelink 9.0.0.1Any help in the area of lookups would be useful as the LAPI documentaion doesn't seem to cover this topic at all.
Find more posts tagged with
Comments
eLink User
Message from Carsten Kulms via eLinkI do _not_ know whether this is valid for version 9.0.0.1:You can retrieve a category version object by FetchCategoryVersion orGetAttributesEx. Then with AttrGetInfo you can get a "AttrInfo" object(an Assoc), which contains a field "ValidValues". See LAPI documentationfor further details.
Kevin_Goodman
Thanks for the reply but I've already tried that, I use AttrGetInfo to get the "type", "required", "length", etc. But for some reason "validvalues" returns nothing for a lookup attribute. The LAPI documentaion says that "validvalues" is for popups only. I've also tried using LL_AttrGetValues as the documentation says that it holds the default values, but all I get is literally the default value for attributes that have them but I can't seem to get the list of values the user can choose from in Livelink for a lookup attribute.Unfortunately this is getting quite urgent now so if anyone else has any ideas at all please, please let me know.Thanks in advance
RCS_upgrade.PNG
RCS_2.PNG
eLink User
Message from Carsten Kulms via eLinkSorry, I missed the "lookup".Afaik the valid values for lookup attributes are not included in theattr info. (Btw: Will be diffcult for cascaded lookup attributes).However, maybe someone else knows more.
Nair_Krishnankutty_(nairkrishnankutty_-_(deleted))
I tried a quick lapi c# sample in my dev environment on a 9.5 sp1.I created a category that has two fields and one of them has pop up values.In looking thru the oscript debugger the FetchcategoryVersion returns three top level assocs data,catID and Definition.The ValidVals is deep inside theDefinition:Childtren.the iteration is what will get you the stuff.Unfortunately in a time crunch myself i have to stop researching this but hopefully somebody who has done this may give you a hand.A snippet included and some screen shots.
Kevin_Goodman
Thanks for the help, I will try this out in VB
Carsten_Kulms
The valid values of a popup attribute can be easily retrieved from the "AttrInfo" obtained from the category version object by the AttrGetInfo function. (see one of the previous posts)Afaik there's no corresponding functionality for "lookup" attributes.
Nair_Krishnankutty_(nairkrishnankutty_-_(deleted))
But in that case lapi will return you a string containing the sql that is running the cascading attributes.I actually thought the poster was asking about valid values like in a text popup situation.