Community
Showing results for 
Search instead for 
Do you mean 
Reply

How to get selected opportunities

Accepted Solution Solved
Tuned Listener
Posts: 38
Country: Poland
Accepted Solution

How to get selected opportunities

which are on the list of opportunities (but only selected) on the view: "Act.UI.IOpportunityView"?

 

Best regards

Bernard


Accepted Solutions
Solution
Accepted by topic author bernardo
‎09-25-2015 03:20 AM
Copper Elite Contributor
Posts: 95
Country: USA

Re: How to get selected opportunities

Assuming Act 12.x or 13.x

 

actApplication.Controls[0].Controls[0].Controls[5] as Act.Shared.Windows.Forms.ActFlexGrid).Rows.Selected.Count

 

will get you the number of opps selected

 

for (int i = 0; i < (OppCountFromAbove; i++)

{


(this returns each opportunity ->>>)

Act.Framework.Opportunities.Opportunity ImAnOpportunity = actApplication.Controls[0].Controls[0].Controls[5] as Act.Shared.Windows.Forms.ActFlexGrid).Rows.Selected[i].DataSource as Act.Framework.Opportunities.Opportunity);

 

}                       

 

Note: you'll need to include C1.Win.C1FlexGrid to do this, and the control numbers that are hardcoded above are subject to change on any and all act patches/version updates, this code works on 12/13 at the moment.

 

-Nick

Nick Bohne
Effective Solutions, Inc.

View solution in original post


All Replies
Solution
Accepted by topic author bernardo
‎09-25-2015 03:20 AM
Copper Elite Contributor
Posts: 95
Country: USA

Re: How to get selected opportunities

Assuming Act 12.x or 13.x

 

actApplication.Controls[0].Controls[0].Controls[5] as Act.Shared.Windows.Forms.ActFlexGrid).Rows.Selected.Count

 

will get you the number of opps selected

 

for (int i = 0; i < (OppCountFromAbove; i++)

{


(this returns each opportunity ->>>)

Act.Framework.Opportunities.Opportunity ImAnOpportunity = actApplication.Controls[0].Controls[0].Controls[5] as Act.Shared.Windows.Forms.ActFlexGrid).Rows.Selected[i].DataSource as Act.Framework.Opportunities.Opportunity);

 

}                       

 

Note: you'll need to include C1.Win.C1FlexGrid to do this, and the control numbers that are hardcoded above are subject to change on any and all act patches/version updates, this code works on 12/13 at the moment.

 

-Nick

Nick Bohne
Effective Solutions, Inc.
Tuned Listener
Posts: 38
Country: Poland

Re: How to get selected opportunities

Thank You very much, it' works.

Although it is a little bit dangerous.

 

Best regards

Bernard

Copper Contributor
Posts: 61
Country: United_Kingdom

Re: How to get selected opportunities

Hello guys,

 

I'm sorry to resurrect an old topic but I couldn't get  (Act.Shared.Windows.Forms.ActFlexGrid).Rows.Selected.Count) I can get to Act.Shared.Windows but after this I can't find the 'Forms' only option is Form and that doesnt have ActFlexGrid is there any other way to get selected opportunity.

 

Thanks

Copper Contributor
Posts: 61
Country: United_Kingdom

Re: How to get selected opportunities

[ Edited ]

I managed to find my way on flexgrid but my problem now is how to assign opportunities to this can you guys @bernardo or @nbohne post the original code, it will be much appriciated. Thanks.

 

Edit: find it guys from: http://community.act.com/t5/Sage-ACT-Developer-s-Forum/Get-selected-opportunity/m-p/55004#M2222 I can get my selected oppotunity and opportunities