Community
Showing results for 
Search instead for 
Do you mean 
Reply

Get GroupUID from Group Name

Accepted Solution Solved
Avid Listener
Posts: 12
Country: USA
Accepted Solution

Get GroupUID from Group Name

Hi,

I am new to ACT and its SDK Programming.

I have been able to create a new contact and add history to it.

Now I want to assign this new contact to a group.

I am trying to get the Group GUID  but I am stuck trying to use filter criteria.

 

grList = actFwk.Groups.GetGroups(grSortCriteria, grFilter)

 

I have the sortCriteria but Im not sure what to use for the filter.

can someone please show me some code to do this.

 

Also is there a better method for this ..  I just want the Group GUID returned if have the group name.

 

Thanks

 


Accepted Solutions
Solution
Accepted by topic author rc_jw
‎09-25-2015 03:20 AM
Employee
Posts: 1,163
Country: USA

Re: Get GroupUID from Group Name

Comparison Filter would probably work:

 

IFilterCriteria filter = new ComparisonFilterCriteria(object, ComparisonFilterCriteria.Operation.Equals, object);

 

Or you could use what you have, leave the filter as null and find the group in your group list by iterating through it. Using the filter though would probably be faster.

Matthew Wood
Act! SDK Support
Community Moderator

View solution in original post


All Replies
Solution
Accepted by topic author rc_jw
‎09-25-2015 03:20 AM
Employee
Posts: 1,163
Country: USA

Re: Get GroupUID from Group Name

Comparison Filter would probably work:

 

IFilterCriteria filter = new ComparisonFilterCriteria(object, ComparisonFilterCriteria.Operation.Equals, object);

 

Or you could use what you have, leave the filter as null and find the group in your group list by iterating through it. Using the filter though would probably be faster.

Matthew Wood
Act! SDK Support
Community Moderator
Avid Listener
Posts: 12
Country: USA

Re: Get GroupUID from Group Name

Thanks for the response.

I am trying to use comparison filtercriteria, however I am getting a casting error from comparisonfiltercriteria to ifiltercriteria??

Avid Listener
Posts: 12
Country: USA

Re: Get GroupUID from Group Name

ok sorry about that. 

 I was able to get the cast to work,

 

however there is no comparisonfiltercriteria.operation.egual,

there is a comparisonfiltercriteria.operation.is , but it is not returning a group.

I can use lessthanorequal, which does return a list of groups with the last one being the one I am expecting,  however it seems there should be a way to return the GUID for the group name I am looking for??

Avid Listener
Posts: 12
Country: USA

Re: Get GroupUID from Group Name

so there is a comparison.equals,  I used 0, and it works..

Thanks for your help