Community
Showing results for 
Search instead for 
Do you mean 
Reply

Filtering opportunities of a contact

Copper Contributor
Posts: 99
Country: Netherlands

Filtering opportunities of a contact

I need to do a kind of Opportunity lookup for opportunities of contact X.

How can i achieve this? I cannot add a 'relatedtocontactx' FilterCrierium like I do for the rest of the criteria:

 

 

CriteriaColumn col = ACTFM.Lookups.GetCriteriaColumn(descriptor);
Criteria crit = new Criteria(LogicalOperator.And, 0, 0, col, OperatorEnum.Contains, value);
crits.Add(crit);



...



OpportunityLookup lookup = ACTFM.Lookups.LookupOpportunitiesReplace(crits.ToArray());

I can off course create a list of Guids with contact.GetOpportunities(null,null) and then do the lookup as above, and then loop through all matching opportunities and then foreach opportunity check if it's ID is in the  list, but that's rather slow and ugly.

 

I think I have to achieve this with the parameters for contact.GetOpportunities (which I am now giving null), but how? I could not find this. It's asking an IFilterCriteria, and I have Criteria objects...

 

How?

Greetings,

ACT Certified Consultants
TendenZ
the Netherlands
Administrator
Posts: 568
Country: United_Kingdom

Re: Filtering opportunities of a contact

Is this still an issue you're looking for advice on? Did you manage to find a resolution in the end?
Copper Contributor
Posts: 99
Country: Netherlands

Re: Filtering opportunities of a contact

Yes, this is still an issue. For now I've implemented the 'slow and ugly' method as described above, but I feel there has to be a more elegant way.

Greetings,

ACT Certified Consultants
TendenZ
the Netherlands
Administrator
Posts: 568
Country: United_Kingdom

Re: Filtering opportunities of a contact

I'll forward this thread on to our developer support team, hopefully they may have some ideas.
Moderator
Posts: 707
Country: USA

Re: Filtering opportunities of a contact

[ Edited ]

Unless I'm missing the scope of what you're doing, I would use GetOpportunitiesByContact() if it's available to you.

 

 *EDIT*

Yeah, just looking over this again, and I believe process is to get opportunities by contact method. (ACTFM.Opportunities.GetOpportunitiesByContact(Guid, IFilterCriteria[]) 

 

Remember, the framework follows many of the examples of the base product.  Act! doesn't have a Lookup Opportunities by Contact, so the framework won't as well.  Instead you can get opportunities for a specified contact, or get contacts for a specified opportunity, but you cannot use an Opportunity Lookup to get that information.

Billy Clark
Swiftpage
Act! Knowledgebase: http://kb.act.com