Community
Showing results for 
Search instead for 
Do you mean 
Reply

An attempt was made to access the framework...

Accepted Solution Solved
Nickel Elite Contributor
Posts: 508
Country: USA
Accepted Solution

An attempt was made to access the framework...

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...

Richard Brust
ACT! Certified Consultant
richard@rbrDataSolutions.com

Accepted Solutions
Solution
Accepted by topic author rbrust
‎09-25-2015 03:20 AM
Employee
Posts: 1,163
Country: USA

Re: An attempt was made to access the framework...

[ Edited ]

If this is a plugin, shouldn't the call to GetGroupFieldDescriptors look like:

 

ActApplication.ActFramework.Groups.GetGroupFieldDescriptors

Matthew Wood
Act! SDK Support
Community Moderator

View solution in original post


All Replies
Solution
Accepted by topic author rbrust
‎09-25-2015 03:20 AM
Employee
Posts: 1,163
Country: USA

Re: An attempt was made to access the framework...

[ Edited ]

If this is a plugin, shouldn't the call to GetGroupFieldDescriptors look like:

 

ActApplication.ActFramework.Groups.GetGroupFieldDescriptors

Matthew Wood
Act! SDK Support
Community Moderator