Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
ImanAttributeDefinitions
Rooose
Hi,
I'm using IManAttributeDefinitions from the my PreferredDatabase object so that i can obtain available fields and their captions. However when i loop through the object 1/2 of the returned fields have no caption or name. Is it possible to get all the fields captions or names, like there is on the "Select Profile Fields" list within Desksite option?
many thanks,
RW
Find more posts tagged with
Comments
jny
What are you trying to accomplish? The DeskSite Option is to show the actual value for each selected field for each document in the docgrid.
Rooose
Hi jny,
In my app i need to allow the user to select which fields they would like to see, so i would like to produce a selection screen with all the available fields on it. - just like within the options in Desksite.
thanks
jny
You can still use the AttributeDefinitions Collection to bring up your own field selection dialog. The IManAttributeDefinition.ID Property returns the numeric value that represents the attributeID/field. For instance, imProfileDatabase (Database) = 0, imProfileDocNum (docnum) = 1, etc.
The AttributeID Enum table in the "Visual Basic Scripting for WorkSite Dialogs.pdf " (which is distributed with the SDK) has the information you need to map the numeric value (returned by the ID Property) to the corresponding attributeID/field.
Rooose
Thats what i thought, but when i do:
Dim profs As IManAttributeDefinitions
Dim prof As IManAttributeDefinition
Set profs = oWrkSession.PreferredDatabase.AttributeDefinitions
For Each prof In profs
MsgBox prof.AttrID & " " & prof.Caption & " " & prof.FieldName
Next prof
the msgbox only displays a caption or fieldname for the custom fields (not descriptions) and most of the general fields such as desciption, name, author etc...
Is this correct? i was expecting the fields to be populated for all the records, so i can build a list of fields just like the one in Desksite options.
many thanks,
RW
jny
What I'm saying is: you would need to hardcode the numeric values of the AttributeID's (found in the AttributeID Enum Table) and map it to the value returned by AttributeDefinition.ID Property, such as using case-switch statement. Like so:
Dim myCaption As String
Select Case prof.ID
Case 0
myCaption = "Database"
Case 1
myCaption = "Document Number"
case 2
' So on, and so forth...
End Select
GanttscriptScale.zip