07-31-2014 12:25 PM
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
07-31-2014 02:57 PM
Here are the relevant methods.
Act.UI.ICompanyDetailView.ShowCompany(Act.Framework.Companies.Company)
or
Act.UI.UICompanyManager.ShowCompany(Act.Framework.Companies.Company)
Stan
07-31-2014 02:57 PM
Here are the relevant methods.
Act.UI.ICompanyDetailView.ShowCompany(Act.Framework.Companies.Company)
or
Act.UI.UICompanyManager.ShowCompany(Act.Framework.Companies.Company)
Stan