Community
Showing results for 
Search instead for 
Do you mean 
Reply

Check current view and Get displaying contact by ACT SDK

Accepted Solution Solved
Copper Contributor
Posts: 11
Country: Canada
Accepted Solution

Check current view and Get displaying contact by ACT SDK

HI,

Any one can help on it:

I am adding a menu/button to do some operation, i need to check by ACT SDK if current view is contact view?, (qustion 1).. if it is current view, then how to get displaying contact (question2). thanks for your help and suggestion !

 

Felix


Accepted Solutions
Solution
Accepted by topic author felixl
‎09-25-2015 03:20 AM
Bronze Elite Contributor
Posts: 2,115
Country: United_Kingdom

Re: Check current view and Get displaying contact by ACT SDK

Hiya,

 

Try something like this:

 

//oActApp is the instance of the current ActApplication object.

 

if(oActApp.CurrentViewName == "Act.UI.ContactDetailView")

{

MessageBox.Show(oActApp.ApplicationState.CurrentContact.FullName);

}

 

Basically the ApplicationState object contains the properties to access the Current[Entity] that the ACT! application is currently viewing.

 

HTH

Vivek 

Vivek Gargav
Caldere Associates Ltd.
www.caldere.com
vgargav@caldere.com
My Blog

View solution in original post


All Replies
Solution
Accepted by topic author felixl
‎09-25-2015 03:20 AM
Bronze Elite Contributor
Posts: 2,115
Country: United_Kingdom

Re: Check current view and Get displaying contact by ACT SDK

Hiya,

 

Try something like this:

 

//oActApp is the instance of the current ActApplication object.

 

if(oActApp.CurrentViewName == "Act.UI.ContactDetailView")

{

MessageBox.Show(oActApp.ApplicationState.CurrentContact.FullName);

}

 

Basically the ApplicationState object contains the properties to access the Current[Entity] that the ACT! application is currently viewing.

 

HTH

Vivek 

Vivek Gargav
Caldere Associates Ltd.
www.caldere.com
vgargav@caldere.com
My Blog
Copper Contributor
Posts: 11
Country: Canada

Re: Check current view and Get displaying contact by ACT SDK

Thanks, vivek,  I was thinkin use oActApp.iContain.ActiveControl.Name, but looks yours is better solution.  

thansk..

-Felix

Copper Contributor
Posts: 11
Country: Canada

Re: Check current view and Get displaying contact by ACT SDK

Hi Vivek,

I found the oActApp.CurrentViewName is"Act.UI.IContactDetailView" instead of "Act.UI.ContactDetailView", but use application.GetContainerControl.ActiveControl.Name, it is "Act.UI.ContactDetailView", interesting.   it also apply to company and other views.

 

 

One more qustion, I added a menu item, but how can I add my this menu item to big icon like "new contact" or "help topics" at first line of view? thanks in advance.

 

 

-Felix