Community
Showing results for 
Search instead for 
Do you mean 
Reply

Using SDK to assign Limited Access to Group (ACT! Premium 2010)

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

Using SDK to assign Limited Access to Group (ACT! Premium 2010)

I need to be able to programmatically create a group and give it the designation of Limited Access. I found a similar post for contacts; however, following the instructions for contacts does not seem to apply here even though a contact and a group are both mutable entities (desperate and wishful thinking!).

 

I create the group and assign it AccessType.Public. I then use Groups.SetAccessors(newGroup, someAccessors) to set access. I was told that this was all I had to do to change it from Public / Public to Public / Limited. Though after I set the accessors, I check newGroup.IsLimitedAccess() and it is still set to false. I even try to do an Update first, and still no go. I check to see that the accessors are actually there with GetAccessors and they are. So I'm left with a new group with accessors yet it's still only Public in the eyes of the thick client and programmatically.

 

I have looked everywhere for a property that will allow me to set a group to Limited access either on the group itself or via the GroupManager, and I'm at a loss. Any help will be fantastically appreciated.

 

- Carol

 


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

Re: Using SDK to assign Limited Access to Group (ACT! Premium 2010)

I replied in an e-mail but had thought that I'd share it here.

 

If we're not limiting to any teams or users, then that may be why the access isn't changing, since the group isn't limited to a team/user etc.

 

Additionally you'll want an instance of the GroupManager and call SetAccessors from it, just from looking at the members of the Group you should be able to do this nearly identically to the example I've provided.

Matthew Wood
Act! SDK Support
Community Moderator

View solution in original post


All Replies
Employee
Posts: 1,163
Country: USA

Re: Using SDK to assign Limited Access to Group (ACT! Premium 2010)

Hello Carol,

 

I don't have an example of this using groups, but I tried to reproduce it with opportunities and was unable to do so, assigning the opportunity to a team also changed the access type to limited within the UI.

 

Here's what I'm using:

 

Opportunity o = _ActApp.ApplicationState.CurrentOpportunity;
if (o.CanChangeAccessType)
{
OpportunityManager oppman = new OpportunityManager(_ActApp.ActFramework);                    
Accessor[] AccessList = new Accessor[1];
Accessor AdminTeam = oppman.GetAccessorAdminTeam();
Accessor Team2 = oppman.GetCurrentUserAccessor();
AccessList[0] = AdminTeam;
oppman.SetAccessors(o, AccessList);
}
Matthew Wood
Act! SDK Support
Community Moderator
New Member
Posts: 3
Country: USA

Re: Using SDK to assign Limited Access to Group (ACT! Premium 2010)

[ Edited ]

Matthew -

 

Thank you for the quick reply. I need this to specifically work for groups. Here is a code snippet:

 

ActFramework ACTFM;

...

Group newGroup = ACTFM.Groups.CreateGroup();
newGroup.Name = "CarolTestZ";
newGroup.AccessType = AccessType.Public;
newGroup.Update(); // Must Update() before setting accessors or will get error "error";
Accessor[] teams = ACTFM.Groups.GetAccessors(); // Will eventually limit to one team;
ACTFM.Groups.SetAccessors(newGroup, teams);
newGroup.Update();


At this point I check newGroup.IsLimitedAccess() and I still get false. I don't know if opportunities work like groups. In my sample, I am not limiting the teams or users that I'm assigning to the new group as I was just trying to test if the existing of accessors on a group are what determine if Limited. In my example, that is not the case.

 

Can you try your example with groups instead of opportunities? I will try too. Maybe it doesn't like that I'm grabbing all accessors in the system? Eventually the point will be to assign a specific team, but I didn't want to spend time on that part until I could at least get this part working.

 

- Carol

 

 

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

Re: Using SDK to assign Limited Access to Group (ACT! Premium 2010)

I replied in an e-mail but had thought that I'd share it here.

 

If we're not limiting to any teams or users, then that may be why the access isn't changing, since the group isn't limited to a team/user etc.

 

Additionally you'll want an instance of the GroupManager and call SetAccessors from it, just from looking at the members of the Group you should be able to do this nearly identically to the example I've provided.

Matthew Wood
Act! SDK Support
Community Moderator
New Member
Posts: 3
Country: USA

Re: Using SDK to assign Limited Access to Group (ACT! Premium 2010)

Thank you! You have made my week. I was doing ok with the group manager...

 

It was my accessors! I had been misinformed that the existence of accessors on a group would make that group Limited. I found the culprit. One of my accessors was "All Users". Clearly this is not limiting in any way. Yet it is still an accessor and I was going off the assumption someone had given me.

 

So my code was good, my logic was iffy, and my accessors were downright horrid. Thank you so much for your help!

 

- Carol

 

Employee
Posts: 1,163
Country: USA

Re: Using SDK to assign Limited Access to Group (ACT! Premium 2010)

Glad to be of assistance Carol, hope you and your have a Merry Christmas.

Matthew Wood
Act! SDK Support
Community Moderator