Community
Showing results for 
Search instead for 
Do you mean 
Reply

How to determine whether in Contact or Company view

Accepted Solution Solved
Tuned Listener
Posts: 15
Country: United_Kingdom
Accepted Solution

How to determine whether in Contact or Company view

Hi

 

I'm just beginning with developing for ACT, and need to determine whether the user is in the Contact view, or in the Company view. I want to enable an option only when a single contact is selected.

 

Is there a flag somewhere that identifies this? Any code snippets appreciated.

 

Thanks

Richard

 


Accepted Solutions
Solution
Accepted by topic author richardk
‎09-25-2015 03:20 AM
Bronze Super Contributor
Posts: 1,231
Country: USA

Re: How to determine whether in Contact or Company view

There is a CurrentViewName property on the ActApplication. Listen to the view changed event to monitor which view the user is currently on.

 

Add a handler to liste to the view changed event

AddHandler ActApplication.CurrentViewChanged, AddressOf HostApplication_CurrentViewChanged

 

  

PrivateSub HostApplication_CurrentViewChanged(ByVal Sender AsObject, ByVal e As System.EventArgs)
   

SelectCase HostApplication.CurrentViewName

CASE "Act.UI.ICompanyDetailView"

                 ' User changed to the COMPANY DETAILS view

CASE "Act.UI.ICompanyListView"

          ' User changed to the COMPANY LIST View

CASE "Act.UI.IContactDetailView"

           ' User changed to the CONTACT DETAILS View

CASE "Act.UI.IContactListView"

              ' User changed to the CONTACT LIST View

End Select

 

EndSub

 

Hope this helps

-- Jim Durkin

View solution in original post


All Replies
Solution
Accepted by topic author richardk
‎09-25-2015 03:20 AM
Bronze Super Contributor
Posts: 1,231
Country: USA

Re: How to determine whether in Contact or Company view

There is a CurrentViewName property on the ActApplication. Listen to the view changed event to monitor which view the user is currently on.

 

Add a handler to liste to the view changed event

AddHandler ActApplication.CurrentViewChanged, AddressOf HostApplication_CurrentViewChanged

 

  

PrivateSub HostApplication_CurrentViewChanged(ByVal Sender AsObject, ByVal e As System.EventArgs)
   

SelectCase HostApplication.CurrentViewName

CASE "Act.UI.ICompanyDetailView"

                 ' User changed to the COMPANY DETAILS view

CASE "Act.UI.ICompanyListView"

          ' User changed to the COMPANY LIST View

CASE "Act.UI.IContactDetailView"

           ' User changed to the CONTACT DETAILS View

CASE "Act.UI.IContactListView"

              ' User changed to the CONTACT LIST View

End Select

 

EndSub

 

Hope this helps

-- Jim Durkin

Tuned Listener
Posts: 15
Country: United_Kingdom

Re: How to determine whether in Contact or Company view

Thanks. Very useful.

Richard