Community
Showing results for 
Search instead for 
Do you mean 
Reply

Impact Suite enhanced Listview causes original SDK non-function

Tuned Listener
Posts: 19
Country: USA

Impact Suite enhanced Listview causes original SDK non-function

I like the beautifully designed UI from "Impact Suite" addon. I've been using it for a while now. Just recently I started to do some customization and had one particular challenge:

 

I try to get the "selected contacts" using the following code:

 

IContactView listView = this.application.UIContactManager.GetContactListView();

Contact selected_contact = listView.GetSelectedContacts();

 

It functions as expected when the Impact Suite "enhanced list livew" is not enabled. I guess, or I think Impact Suite has to, added a layer of its own API that causes this behavior. Can anybody let me know how to get this done while still using its beautifully designed list view?

 

Much appreciated!

Steve

Bronze Super Contributor
Posts: 1,231
Country: USA

Re: Impact Suite enhanced Listview causes original SDK non-function

[ Edited ]

Yes, Impact Suite adds its own UI layer on top of the ACT UI. That is why Impact Suite ALSO has its own SDK.

 

Attached is an example C# solution which:


1) Adds a button to Impact's enhanced Contact List View.  The button reads "IMPACT SDK"


2) Clicking on this button will return a contactList of the selected contacts. In this example we open a messagebox with the count of the selected contacts.

 

The code looks like this

Contacts.ContactList ContactListSelected = this.usrViewContactList.GetContactListSelected(true);
MessageBox.Show( ContactListSelected.Count.ToString() +" selected contacts");

 

2015-07-24_12-14-49.jpg

 

 

 

The example project also show how you can sign up for Impact Events such as...

 

//----------------------------------------------------------------------------
// Sign up for the TAB Events
// these are the tabs added to the Contacts, Companies, anf Groups views
//----------------------------------------------------------------------------
Durkin.Common.Toolkit.Tabs.BeforeNew += ToolkitEvent_CustomTabBeforeNew;
Durkin.Common.Toolkit.Tabs.AfterNew += ToolkitEvent_CustomTabAfterNew;
Durkin.Common.Toolkit.Tabs.Loaded += ToolkitEvent_CustomTabLoaded;

//----------------------------------------------------------------------------
// Sign up for the VIEW events
// CustomView are accessed by the left navigation panel
//----------------------------------------------------------------------------
Durkin.Common.Toolkit.Views.BeforeNew += ToolkitEvent_CustomViewBeforeNew;
Durkin.Common.Toolkit.Views.AfterNew += ToolkitEvent_CustomViewAfterNew;
Durkin.Common.Toolkit.Views.Loaded += ToolkitEvent_CustomViewLoaded;
Durkin.Common.Toolkit.Views.ViewChanged += ToolkitEvent_CustomViewChanged;

//----------------------------------------------------------------------------
// Sign up for the EventToolbarClick event to handle when a users
// clicks on a toolbar or menu in the custom TABS or VIEWS
//----------------------------------------------------------------------------
Durkin.Common.Views.usrViewGeneric.EventCommandClick += ToolkitEvent_CommandClick;

 

//----------------------------------------------------------------------------
// Sign up for the EntityItemsChanged event'
// Similar to ACT's CurrentContact mechinism but since we can select multiple
// SubEntity Items from the list this event is raised whenever the selected items change
//----------------------------------------------------------------------------
Durkin.Common.Views.usrViewGeneric.EventCurrentEntityItemsChanged += ToolkitEvent_EventCurrentEntityItemsChanged;

//----------------------------------------------------------------------------
// Sign up for the EntityEvents such as New Modify and delete. These events
// are raised from the Toolkit User Interface lick buttons and menus hits
//----------------------------------------------------------------------------
Durkin.Common.Views.usrViewGeneric.EventAfterNew += ToolkitEvent_EventAfterNew;
Durkin.Common.Views.usrViewGeneric.EventAfterEdit += ToolkitEvent_EventAfterEdit;

// Some additional AFTER events
Durkin.Common.Views.usrViewGeneric.EventAfterDelete += ToolkitEvent_EventAfterDelete;
Durkin.Common.Views.usrViewGeneric.EventAfterDuplicate += ToolkitEvent_EventAfterDuplicat;
Durkin.Common.Views.usrViewGeneric.EventAfterOptions += ToolkitEvent_EventAfterOptions;
Durkin.Common.Views.usrViewGeneric.EventAfterRefresh += ToolkitEvent_EventAfterRefres;
Durkin.Common.Views.usrViewGeneric.EventAfterSave += ToolkitEvent_EventAfterSave;

// Additional BEFORE events
Durkin.Common.Views.usrViewGeneric.EventBeforeEdit += ToolkitEvent_EventBeforeEdit;
Durkin.Common.Views.usrViewGeneric.EventBeforeDelete += ToolkitEvent_EventBeforeDelete;
Durkin.Common.Views.usrViewGeneric.EventBeforeOptions += ToolkitEvent_EventBeforeOptions;
Durkin.Common.Views.usrViewGeneric.EventBeforeSave += ToolkitEvent_EventBeforeSave;

 

//----------------------------------------------------------------------------
// RemoveDurkinDataEntryHandlers first so we are not duplicated
// This is needed in VB.net but in C# we could do it differently
//----------------------------------------------------------------------------
RemoveDurkinDataEntryHandlers();

Durkin.Common.Classes.frmSubEntityItemEditDurkin.CurrentFieldValidating += ToolkitEvent_CurrentFieldValidating;

Durkin.Common.Classes.frmSubEntityItemEditDurkin.frmSubEntityItemEditDurkinClose += ToolkitEvent_frmSubEntityItemEditDurkinClose;
Durkin.Common.Classes.frmSubEntityItemEditDurkin.frmSubEntityItemEditDurkinOpen += ToolkitEvent_frmSubEntityItemEditDurkinOpen;

// Additional Events to watch
Durkin.Common.Classes.frmSubEntityItemEditDurkin.EventFormClose += ToolkitEvent_frmSubEntityItemEditDurkinClose;
Durkin.Common.Classes.frmSubEntityItemEditDurkin.EventFormOpen += ToolkitEvent_frmSubEntityItemEditDurkinOpen;
Durkin.Common.Classes.frmSubEntityItemEditDurkin.CurrentSubItemChanged += ToolkitEvent_CurrentSubItemChanged;
Durkin.Common.Classes.frmSubEntityItemEditDurkin.CustomSubEntityBeforeSave += ToolkitEvent_CustomSubEntityBeforeSave;
Durkin.Common.Classes.frmSubEntityItemEditDurkin.CustomSubEntityCancel += ToolkitEvent_CustomSubEntityCancel;
Durkin.Common.Classes.frmSubEntityItemEditDurkin.CustomSubEntityDelete += ToolkitEvent_CustomSubEntityDelete;
Durkin.Common.Classes.frmSubEntityItemEditDurkin.CustomSubEntityNew += ToolkitEvent_CustomSubEntityNew;
Durkin.Common.Classes.frmSubEntityItemEditDurkin.CustomSubEntitySave += ToolkitEvent_CustomSubEntitySave;

 

This is only the list of events in the sample project attached.

 

 

Thanks

-- Jim Durkin

 

 

 

 

Tuned Listener
Posts: 19
Country: USA

Re: Impact Suite enhanced Listview causes original SDK non-function

Jim,

Thanks for a detailed example. Howver I can't get it to work still.

 

In your code, the usrViewGeneric gets its value only at event CustomViewAfterNew, see below:

 

=================

private void ToolkitEvent_CustomViewAfterNew(object sender, object e)

{

     if (((Durkin.Common.Views.usrViewGeneric)sender).EntityName == "Contact")

    {

         this.usrViewContactList = (Durkin.Common.Views.usrViewGeneric)sender;

    }

 

}

=================

But I'm not creating any new custom views, I just use the existing enhanced contact list view. How can I get the value of that?

 

Also, I'd like to be able to tell if enhanced view is used, so I can make my code work for both situation, with or without impact suite. Could you please help?

 

When I change between views, the event sender is always ''Act.UI.ActApplication'.

Bronze Super Contributor
Posts: 1,231
Country: USA

Re: Impact Suite enhanced Listview causes original SDK non-function

Our class usrViewGeneric is used for custom tables and ALL the enhanced views in the UI.

 

usrViewGeneric handles all entity types such as; contacts, companies, groups, opportunities, histories, notes, tasks and custom tables.

 

So yes this.usrViewContactList  gets its value at event CustomViewAfterNew. If you look further down in the example you will see this code:

 

Contacts.ContactList ContactListSelected = this.usrViewContactList.get_GetContactListSelected(true);

MessageBox.Show( ContactListSelected.Count.ToString() +" selected contacts");

 

 

Also, I'd like to be able to tell if enhanced view is used

If this.usrViewContactList is not null AND this.usrViewContactList.Visible = true then its being used.

 

When I change between views, the event sender is always ''Act.UI.ActApplication'.

Yes, I am raising the ACT UI object. Did you need something else?

 

-- Jim Durkin

 

Tuned Listener
Posts: 19
Country: USA

Re: Impact Suite enhanced Listview causes original SDK non-function

I'm getting a null usrViewContactList even though Impact Suite is loaded and enabled. That's where my trouble comes.

 

Also in your example, method get_GetContactListSelected does NOT exist. I saw to 'get', is it a typo or did I miss something?

Tuned Listener
Posts: 19
Country: USA

Re: Impact Suite enhanced Listview causes original SDK non-function

CustomViewAfterNew event never triggered in my case.

Tuned Listener
Posts: 19
Country: USA

Re: Impact Suite enhanced Listview causes original SDK non-function

The only event that can be trigered is Durkin.Common.Toolkit.Views.ViewChanged

that's why usrViewContactList never get its value.

Please help.

 

Tuned Listener
Posts: 19
Country: USA

Re: Impact Suite enhanced Listview causes original SDK non-function

Jim,

 

So we might talk about different things. You are talking about the "costom vew", the circled part below. I'm talking about just the "contact lis view".

Impact Suite does include an enhanced version that allows user to store column arrangement, add colors, etc.

I want to get a contactlist that contains all selected items from "contact list view". I'm NOT building any "custom view".

All those events, "BeforeNew", "AfterNew" "ViewLoaded" relate to "custom view".

Untitled.png

Bronze Super Contributor
Posts: 1,231
Country: USA

Re: Impact Suite enhanced Listview causes original SDK non-function

Yes Impact Suite uses and raised our urrViewGeneric for the contact list view. Its all the same view used for custom tables or native ACT entities.

 

In the example check out the message box which displays the count of selected contacts.

 

I will be in the office Monday if you want to do a short web session.

 

-- Jim Durkin

 

Tuned Listener
Posts: 19
Country: USA

Re: Impact Suite enhanced Listview causes original SDK non-function

Apparently urrViewGeneric  was not raised in my situation when I simply changed to "Contact List View". It does only when I change to "Custom View" such as the "Note" and "History" view from the left side panel.

 

It will be great if we can do the web session. How and when? I'm in CA.