09-16-2010 02:14 PM
Is it possible to access the current ACT! application instance from a Dashboard component so I can double click on a grid in a dashboard and go to a Contact, Company, etc.?
Currently working with ACT! 2009, but would like to know if this is possible for any ACT! version since Dashboards were introduced.
09-17-2010 07:11 AM
I haven't done this from within a custom component. Even if it can't, I suspect at worst case you'd be able to create a second class that implements IPlugin and pass in the ActApplication.
09-17-2010 07:26 AM
I agree with Matt.
Just an FYI - in ACT! 2011 the datachart control automatically creates a link for any contact records viewed in a datagrid output. It sounds like the behavior you're looking for so it might be a good reference to take a look at.
09-17-2010 07:31 AM
Thanks for the responses. I did see the new functionality in ACT! 2011. Is there documentation in the SDK to edit the DataChart control to display data beyond what Sage provides out of the box? I couldn't find any.
Thanks again.
Mike Fortier
Fortier Consulting, LLC
11-07-2010 08:30 AM
The ActApplication instance is the same thing as the main form for ACT! for Windows. Just do MyControl.FindForm and it will hand you a System.Windows.Forms.Form that can be directly converted to an ActApplication. From there, you can do whatever you like. The same thing works for custom controls as well.
Greg Ferber
DesignR1 Programming Director
11-07-2010 10:34 PM
11-16-2010 03:22 AM - edited 11-16-2010 03:22 AM
I create a button as UserControl and add it to new Tab in Contcts. If i do myForm.FindForm() i get object Act.UI.ContactViews.ContactDetailView not ActApplication. How can i get access to ActApplication? I also try to implement IPlugin, but OnLoad method does not fires.
Darek
11-16-2010 08:26 AM - edited 11-16-2010 08:28 AM
You may have to do a recursive function to find the ultimate ACTAPP doing control.Parent.FindForm until you get the type Act.UI.ActApplication. Something like the following should do the trick:
Private Function FindACTAPP(ByVal TheControl As System.Windows.Forms.Control) As Act.UI.ActApplication
Dim MyACTAPP As Act.UI.ActApplication = Nothing
If TheControl.FindForm.GetType Is GetType(Act.UI.ActApplication) Then
MyACTAPP = TheControl.FindForm
Else
MyACTAPP = FindACTAPP(TheControl.Parent)
End If
Return MyACTAPP
End Function
Alternatively, you can iterate through Application.OpenForms, assuming you're using VB. I'm not sure how to get the Application namespace in C#. I use this exact code in one of our ACT! Custom Controls to get ACTAPP:
If ACTAPP Is Nothing Then
For i As Integer = 0 To (Application.OpenForms.Count - 1)
If Application.OpenForms(i).GetType Is GetType(Act.UI.ActApplication) Then
ACTAPP = Application.OpenForms(i)
ACTFM = ACTAPP.ActFramework
End If
Next
End If