cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

how to write service for remove user from user group??

RM12
14-Alexandrite

how to write service for remove user from user group??

Hello,

         I want automatically remove the member from user group by using service. please suggest how do I write code to remove member from user group ??

Thanks in advance

ACCEPTED SOLUTION

Accepted Solutions
mgoel
17-Peridot
(To:RM12)

@RM12  

 

Check below code, i have just tried it and it is working for me. Change user and group as per your data.

 

var params = {

member: "MohitUser1" /* STRING */,

type: "User" /* STRING */

};

// no return

Groups["users1"].DeleteMember(params);

 

Do let me know in case of any question.

Regards,

Mohit

View solution in original post

4 REPLIES 4
tdixit
15-Moonstone
(To:RM12)

 Hi @RM12 

 

Thank you for reaching out to PTC

 

Please check this post and see if it helps you with your use case

 

Regards,

Toolika Dixit

RM12
14-Alexandrite
(To:tdixit)

Thanks for your reply I 'll refer this post. it only gives how to add a User to Developer Group and I just want to remove that user from user group I don't want to remove manually .please suggest how do I automatically remove user from user group??

 

 

tdixit
15-Moonstone
(To:RM12)

Hello @RM12 

 

Have you checked the default services available under Organization, Groups and even for individual users. Like for a particular Group you have services like AddMember(), AssignMembers(), DeleteMembers() and you'll see similar ones for Organization as well.

 

Regards,

Toolika Dixit

mgoel
17-Peridot
(To:RM12)

@RM12  

 

Check below code, i have just tried it and it is working for me. Change user and group as per your data.

 

var params = {

member: "MohitUser1" /* STRING */,

type: "User" /* STRING */

};

// no return

Groups["users1"].DeleteMember(params);

 

Do let me know in case of any question.

Regards,

Mohit

Announcements


Top Tags