Community
Showing results for 
Search instead for 
Do you mean 
Reply

How To Update View After Setting CurrentCompany

Accepted Solution Solved
New Member
Posts: 2
Country: USA
Accepted Solution

How To Update View After Setting CurrentCompany

I have created a plugin for my install of Act! that does some custom searching. In the results, I have Act!'s companyid for each row. When I click on a row on my grid, I want to have that company show in Act!

 

I can successfully get the company. I can set that company as the current company list and call the ExecuteCommand to switch the Act! interface to that view:

 

var companies = _app.ActFramework.Companies.GetCompaniesByID(sortAlpha, guids.ToArray());
_app.ApplicationState.CurrentCompanyList = companies;
_app.ExecuteCommand("act-ui://com.act/application/menu/view/companylist");

 

This works great. But what I would rather do is have the company come up in the Details View. So they don't have to click on the company again in Act!.

 

I have the following code:

 

// This first line just gets the company id (guid) from the grid view of my plugin and uses it to query Act for the company

var companies = _app.ActFramework.Companies.GetCompaniesByID(sortAlpha, new[]  Guid.Parse(view.GetRowCellValue(info.RowHandle, "CompanyId").ToString())});
_app.ApplicationState.CurrentCompany = companies[0];

 

This does in fact set the CurrentCompany field as I can check it later and the correct company is stored. The problem is that the interface never updates. If I am sitting on the Details View back in Act!, it never moves. If I am on a different view and call the ExecuteCommand to go to the company view, then the CurrentCompany value gets changed back to the first company in my database and it is displayed.

 

I've dug through the SDK and this forum and haven't been able to find a solution. This is one of those things that just seems so simple, but I can't get it to happen. Any help would be appreciated.

 

Trent


Accepted Solutions
Solution
Accepted by rkain (Copper Super Contributor)
‎09-25-2015 03:20 AM
Silver Super Contributor
Posts: 2,328
Country: USA

Re: How To Update View After Setting CurrentCompany

Here are the relevant methods.

 

Act.UI.ICompanyDetailView.ShowCompany(Act.Framework.Companies.Company)

 

or

 

Act.UI.UICompanyManager.ShowCompany(Act.Framework.Companies.Company)

 

Stan


If you would like to get more out of ACT! you can find an ACT! Certified Consultant near you by going to:www.act.com/acc.
-------------------------------------------------------------------------------------
Stan Smith
ACT! Certified Consultant
ADS Programming Services, Inc.
(205) 222-1661
www.adsprogramming.com
www.actwebhosting.com
Click Here to Purchase Act!

View solution in original post


All Replies
Solution
Accepted by rkain (Copper Super Contributor)
‎09-25-2015 03:20 AM
Silver Super Contributor
Posts: 2,328
Country: USA

Re: How To Update View After Setting CurrentCompany

Here are the relevant methods.

 

Act.UI.ICompanyDetailView.ShowCompany(Act.Framework.Companies.Company)

 

or

 

Act.UI.UICompanyManager.ShowCompany(Act.Framework.Companies.Company)

 

Stan


If you would like to get more out of ACT! you can find an ACT! Certified Consultant near you by going to:www.act.com/acc.
-------------------------------------------------------------------------------------
Stan Smith
ACT! Certified Consultant
ADS Programming Services, Inc.
(205) 222-1661
www.adsprogramming.com
www.actwebhosting.com
Click Here to Purchase Act!