Community
Showing results for 
Search instead for 
Do you mean 
Reply

Setting a team as accessor to a contact

Accepted Solution Solved
Astute Commentator
Posts: 168
Country: United States
Accepted Solution

Setting a team as accessor to a contact

I'm trying to set a team as accessors to a new  contact that I have created.

 

Finding it hard to convert the team to accessors. Is there an easy way of doing this?

 

            Dim guidTeam As System.Guid
            Dim tmAccessorTeam As Act.Framework.Teams.Team
            guidTeam = New System.Guid(guidTeamID)
            tmAccessorTeam = ACTFM.Teams.GetTeam(guidTeam)

           ' How do I now set tmAccessorTEam as Accessors for New_Contact?

 

 


Accepted Solutions
Solution
Accepted by rkain (Copper Super Contributor)
‎09-25-2015 03:20 AM
Copper Super Contributor
Posts: 86
Country: United_Kingdom

Re: Setting a team as accessor to a contact

[ Edited ]

Hi Thatch2,

 

Sorry for a late reply, we do our best to respond to as many threads as we can.

However a response from Swiftpage cannot always be guaranteed, the focus of the community forum is to receive support from your peers.

 

I have a basic code sample below that lets you set contact access for either teams, users or both.

In this example I have already created a team called "My Team" and set access to the current contact accordingly.

I'm afraid it's in C#, but I'm sure that it should point you in the right direction.

 

using Act.Framework.Contacts;
using Act.Framework.MutableEntities;

// FOR THIS DEMO, THE CONTACT OBJECT IS JUST THE CURRENT CONTACT
Contact c = actApp.ApplicationState.CurrentContact;

// MAKE SURE ACCESS CAN BE CHANGED
if(c.CanChangeAccessType)
{
    // ARRAY TO HOLD NEW ACCESS LIST, AND ALSO GET ALL AVAILABLE ACCESSORS
    Accessor[] NewAccessList = new Accessor[1];
    Accessor[] AllAccessors = actApp.ActFramework.Contacts.GetAccessors();

    // LOOP THROUGH THE ACCESSOR LIST TO FIND WHAT YOU WANT BY NAME (TEAMS AND USERS ARE IN HERE)
    int count = 0;
    foreach(Accessor ac in AllAccessors)
    {
        if(ac.Name == "My Team")
        {
            NewAccessList[count] = ac;
            count += 1;
        }
    }
// UPDATE THE CONTACT WITH THE NEW ACCESS LIST actApp.ActFramework.Contacts.SetAccessors(c, NewAccessList);

}

 

We are currently in the process of formalising our developer program here at Swiftpage and hope to have further announcements soon. If you're interested in becoming part of our developer program then send me your details in a private message and I'll be sure to add you to our contact list for future consideration.

 

I hope this helps!

Kind regards,

 

Sam.

____________________________________________________________

Unfortunately I no longer work for Swiftpage International. Please do not send any queries to this account.

View solution in original post


All Replies
Astute Commentator
Posts: 168
Country: United States

Re: Setting a team as accessor to a contact

Any ideas on how to set Team limited access for a contact?

Astute Commentator
Posts: 168
Country: United States

Re: Setting a team as accessor to a contact

Is anyone from Swiftpage involved in answering SDK questions? I've posted this question almost a week ago and no response has been received....

Solution
Accepted by rkain (Copper Super Contributor)
‎09-25-2015 03:20 AM
Copper Super Contributor
Posts: 86
Country: United_Kingdom

Re: Setting a team as accessor to a contact

[ Edited ]

Hi Thatch2,

 

Sorry for a late reply, we do our best to respond to as many threads as we can.

However a response from Swiftpage cannot always be guaranteed, the focus of the community forum is to receive support from your peers.

 

I have a basic code sample below that lets you set contact access for either teams, users or both.

In this example I have already created a team called "My Team" and set access to the current contact accordingly.

I'm afraid it's in C#, but I'm sure that it should point you in the right direction.

 

using Act.Framework.Contacts;
using Act.Framework.MutableEntities;

// FOR THIS DEMO, THE CONTACT OBJECT IS JUST THE CURRENT CONTACT
Contact c = actApp.ApplicationState.CurrentContact;

// MAKE SURE ACCESS CAN BE CHANGED
if(c.CanChangeAccessType)
{
    // ARRAY TO HOLD NEW ACCESS LIST, AND ALSO GET ALL AVAILABLE ACCESSORS
    Accessor[] NewAccessList = new Accessor[1];
    Accessor[] AllAccessors = actApp.ActFramework.Contacts.GetAccessors();

    // LOOP THROUGH THE ACCESSOR LIST TO FIND WHAT YOU WANT BY NAME (TEAMS AND USERS ARE IN HERE)
    int count = 0;
    foreach(Accessor ac in AllAccessors)
    {
        if(ac.Name == "My Team")
        {
            NewAccessList[count] = ac;
            count += 1;
        }
    }
// UPDATE THE CONTACT WITH THE NEW ACCESS LIST actApp.ActFramework.Contacts.SetAccessors(c, NewAccessList);

}

 

We are currently in the process of formalising our developer program here at Swiftpage and hope to have further announcements soon. If you're interested in becoming part of our developer program then send me your details in a private message and I'll be sure to add you to our contact list for future consideration.

 

I hope this helps!

Kind regards,

 

Sam.

____________________________________________________________

Unfortunately I no longer work for Swiftpage International. Please do not send any queries to this account.
Astute Commentator
Posts: 168
Country: United States

Re: Setting a team as accessor to a contact

Thank you. I'll give that a try today and see. I'll get back with the results.

 

T

Astute Commentator
Posts: 168
Country: United States

Re: Setting a team as accessor to a contact

I tested it and it worked well. Thank you very much.

 

I am already a developer of ACT! addons and we are on your mailing list. However, SDK-related responses have been painfully slow (2-3 weeks). Hopefully this improves. In this case, our product has been put on hold until your answer. We can now release it.

 

Again, thank you.

 

T