09-27-2010 09:26 AM
I have a one module (page?) plugin that does a simple message pop-up box. I wanted to add to it to check if a field exists, but am getting the following error when debugging:
An attempt was made to access the framework without having logged on to a database. Please log on to a database first.
The code is currently in the AfterLogon sub, I've also moved it to another sub/function, called *from* AfterLogon, but that does not matter. Here's the basics:
Dim displayName As String = "FieldName_Im_looking_for" Dim gFields() As GroupFieldDescriptor gFields = ActFwk.Groups.GetGroupFieldDescriptors '<<<gFields never is assigned anything, this is where I notice the "error" For Each field As GroupFieldDescriptor In gFields If field.DisplayName = displayName Then MessageBox.Show("Found Field") End If Next
I've read other posts about passing ActApp or ActFwk, but those are defined at the top of the module. Thanks for any pointers!
p.s. I've run this block of code from a command line driver program, where I just logon and search for the field, and it works fine. It seems to be running from plugin is where something is "breaking". Thxs...
09-27-2010 10:24 AM - edited 09-27-2010 10:24 AM
If this is a plugin, shouldn't the call to GetGroupFieldDescriptors look like:
ActApplication.ActFramework.Groups.GetGroupFieldDescriptors
09-27-2010 10:24 AM - edited 09-27-2010 10:24 AM
If this is a plugin, shouldn't the call to GetGroupFieldDescriptors look like:
ActApplication.ActFramework.Groups.GetGroupFieldDescriptors