Community
Showing results for 
Search instead for 
Do you mean 
Reply

Problem accessing GetHistoryType

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

Problem accessing GetHistoryType

Trying to implement this:

GetHistoryType(ByVal typeName As String) As Act.Framework.Histories.HistoryType

  Member of Act.Framework.Histories.HistoryManager

 

I have a console program to test that works:

Dim getHistTypeFromField As HistoryType
Dim insertNewHistory As History

  Try
    getHistTypeFromField = ActFwk.Histories.GetHistoryType("Added Value 123")
    insertNewHistory = ActFwk.Histories.CreateHistory...

 

However, when I try to implement a plugin, the same lines (generally):

Private getHistTypeFromField As HistoryType
Private insertNewHistory As History
<etc Subs in Plugin>

Private Sub Fields_FieldChanged(ByVal fieldName As String)
<lines removed>
  Try
    getHistTypeFromField = Act.Framework.Histories.HistoryManager.GetHistoryType("Added Value 123")
    insertNewHistory = Act.Framework.Histories.HistoryManager.CreateHistory _...

 The GetHistoryType is underlined in "sqiuggly" blue and when I hover it says "Reference to a non-shared member requires an object reference."

 

I've tried different iterations of the line, different Import lines, and nothing seems to work, although I though I had matched the console program.

 

Any ideas?

 

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: Problem accessing GetHistoryType

I'm not 100% certain this is the issue, but if you're inside a plug-in, when you reference ActFramework, it should be from your ActApplication object. So instead of Act.Framework..., it should be ActApp.ActFramework... (where ActApp is your instance of the ActApplication object)

 

Let me know if this doesn't solve it.

Matthew Wood
Act! SDK Support
Community Moderator

View solution in original post


All Replies
Nickel Elite Contributor
Posts: 508
Country: USA

Re: Problem accessing GetHistoryType

I probably missed it earlier, but now the CreateHistory line is the same error status. Though that one was working, but prob not...
Richard Brust
ACT! Certified Consultant
richard@rbrDataSolutions.com
Solution
Accepted by topic author rbrust
‎09-25-2015 03:20 AM
Employee
Posts: 1,163
Country: USA

Re: Problem accessing GetHistoryType

I'm not 100% certain this is the issue, but if you're inside a plug-in, when you reference ActFramework, it should be from your ActApplication object. So instead of Act.Framework..., it should be ActApp.ActFramework... (where ActApp is your instance of the ActApplication object)

 

Let me know if this doesn't solve it.

Matthew Wood
Act! SDK Support
Community Moderator