Bitrix24 Community

Support » Forum » Bitrix24 general questions » Delete Workgroup through business process
Pages: 1
RSS
Delete Workgroup through business process, Using a business process to delete created workgroup
Through a business process a new workgroup can be created.

How would it be possible to delete the created workgroup (after some specific conditions have been met).

I couldn't find any item in the BP editor. Would it be possible to delete the workgroup through execution of a php script?

If so could someone please point me in the right direction to where I could find the documentation for the API of workgroups?
Roger, as far as I know you will need to use the API to do this. See:

https://training.bitrix24.com/rest_help/socialnetwork/sonet_group/index.php

Ronaldo
---
Ronaldo Radünz

Bitrix24 Gold Partner
http://www.radsolucoes.com.br
Thank you that was already helpful, is there a way to test the php code inside bitrix?

Specifically logging the output of variables would be helpful.

I haven't found a way to run the php code to test the functionality.

Any help or link to a tutorial how to get started would be helpful.

I tried the following in the control panel PHP command line:
Code
$rs = CSocNetGroup::GetList();

while ($f = $rs->Fetch() )
   echo $f['ID'].' ';



But I only get a loading popup which never produces any output.
Edited: Roger Küng - 07/15/2016 01:56:19
Roger, you can run PHP code inside a workflow (business process) in the self-hosted version.

See this:
https://training.bitrix24.com/support/training/course/?COURSE_ID=55&LESSON_ID=6897

Use the LOG action to show the value of variables, or post them to the stream.

Ronaldo
---
Ronaldo Radünz

Bitrix24 Gold Partner
http://www.radsolucoes.com.br
Thank you for the advice.

We tried it inside the PHP console.

The following works as expected:

Code
$res = CUser::GetList();

while ($s = $res->Fetch() )
   echo 'test ';
But for the social network groups it only shows a little loading popup on the top right, but never any result is printed.
Code
$res = CSocNetGroup::GetList();
while ($s = $res->Fetch() )
   echo 'test ';

So it appears there is a problem with the 'GetList()' call to the 'CSocNetGroup'

Why might this be the case? The method I got from the link you provided in the first reply.

Any help would be appreciated.
Roger, this is out of my league...please create a ticket at https://helpdesk.bitrix24.com/
---
Ronaldo Radünz

Bitrix24 Gold Partner
http://www.radsolucoes.com.br
Hi Roger,

Could you please try the below from the PHP command line in bitrix
Code
require_once("/home/bitrix/www/bitrix/modules/socialnetwork/include.php");

$res = CSocNetGroup::GetList();
while ($s = $res->Fetch() )
   echo $s['ID'].' ';
Also please check which version of the social network module you are currently on, and let me know
CloudXchange NZ
Bitrix Gold Partner
info@cloudxchange.co.nz
Thank you!
Quote
require_once("/home/bitrix/www/bitrix/modules/socialnetwork/include.php");
with the require it works.

We are currently using version 16.5.3 of the Social network module.

Any particular reason why a require statement is necessary for the social network but not for Groups, Users etc.?
Hi Roger,

Glad to help.

The require is necessary because the social network module isn't loaded on the PHP command line page.

You don't need a require for Users (or User groups) because they are a part of the "Main" module which gets loaded by default on all Bitrix pages.
CloudXchange NZ
Bitrix Gold Partner
info@cloudxchange.co.nz
Pages: 1
2,000,000+
organizations
are already using Bitrix24