Community
Showing results for 
Search instead for 
Do you mean 
Reply

Access ACT! Application Instance within Dashboard

Loyal Listener
Posts: 69
Country: United States

Access ACT! Application Instance within Dashboard

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.

 

Best Regards,
 

Mike Fortier
Fortier Consulting, LLC
 
ACT! Customizations, Training, and Support
 
 
NH: 603-330-0583
ME: 207-221-5657
 
FAX: 501-694-7699
Employee
Posts: 1,163
Country: USA

Re: Access ACT! Application Instance within Dashboard

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.

Matthew Wood
Act! SDK Support
Community Moderator
Nickel Elite Contributor
Posts: 937
Country: USA

Re: Access ACT! Application Instance within Dashboard

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.

 

Loyal Listener
Posts: 69
Country: United States

Re: Access ACT! Application Instance within Dashboard

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

 
ACT! Customizations, Training, and Support
 
 
NH: 603-330-0583
ME: 207-221-5657
Copper Contributor
Posts: 29
Country: USA

Re: Access ACT! Application Instance within Dashboard

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

gregf@designr1.com

Bronze Elite Contributor
Posts: 2,115
Country: United_Kingdom

Re: Access ACT! Application Instance within Dashboard

Greg you are a star!
Vivek Gargav
Caldere Associates Ltd.
www.caldere.com
vgargav@caldere.com
My Blog
Tuned Listener
Posts: 3
Country: Poland

Re: Access ACT! Application Instance within Dashboard

[ Edited ]

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

Copper Contributor
Posts: 29
Country: USA

Re: Access ACT! Application Instance within Dashboard

[ Edited ]

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