09-02-2008 04:22 PM
Hi everyone,
I am currently working on an APFW plugin that which is supposed to display the contents of a custom entity that hangs off the Contact entity in ACT.
I've got the plugin to load with no problems, my only issue at the moment is that when I databind the Asp.net grid to the Custom entity list I end up with a messy grid fields display and no data.
some psuedo Code to illustrate what am trying to do:
----------------------------------------------------
Dim oManager As Act.Framework.CustomEntities.CustomSubEntityManager(Of CustomTable) = ACTSessionManager.Framework.CustomEntities.GetSubEntityManager(Of CustomTable)(oDescriptor)
Dim oRecords As Act.Framework.CustomEntities.CustomEntityList(Of CustomTable) = oManager.GetCustomSubEntities(Clist(0), Nothing)
If Not IsNothing(oRecords) then
'Add the Field descriptors from the custom entity to oRecords here
end if
Try
FarmsGrid.DataSource=oRecords
FarmsGrid.DataBind
Catch ex as exception
End try
-------------------------------------------------------------------------
The binding code seems to execute with no exceptions but the grid only displays field headers with numbers and underscores, eg for a Farm Name field the display is Farm_NAME_2033453453 , any ideas of how I can get this work?
Many thanks in advance
09-05-2008 01:27 PM
At a glance (and I'm no expert),
I think when you do a List (Of something), "something" should be the rows that are populating the list.
I think when you are specifying:
Dim oRecords As Act.Framework.CustomEntities.CustomEntityList(Of CustomTable)
CustomTable is a data structure that contains definitions (descriptors) of the data that is inside of it. So when you do a list of CustomTable, you are getting all of the descriptor names in that table.
You might want to try doing a List(Of CustomTableRow) or whatever the equivalent is.
I may be way off base here.
I'm also not sure what GetCustomSubEntities returns. Maybe by default it returns the name of the descriptor field instead of the value inside of it?