Bitrix KP. Copying universal lists and business processes. Creating a list Flexible customization of any business processes

I would like to present a functionality that is very important for many developers, which will find (and is already finding) wide application in 1C-Bitrix products - both in Site Management and in the Corporate Portal. It is especially important if we take into account the current trend of the present time - that a website is now not just a website as a presentation of a company, but more and more as a business application, as a functionality for organizing interaction with partners and clients. We will talk about Universal Lists using Grid technology. We will talk a little about the Grids themselves - only at the “what is it” level. Let’s take a closer look at Universal Lists - how exactly the “kitchen” of Grids is used in this module, why it greatly simplifies the work of a web developer in creating all kinds of lists on sites, and allows the user to work with them easily and conveniently.

A little about Grids

1C-Bitrix technical support constantly receives questions on the topic: “How about taking what’s in the admin panel “out into the street” to people?” Indeed, how to present some functionality in the “public”, for example, universal grids? And not just present it, but also give you the opportunity to enter data there?

When developing a new product - "Corporate Portal", 1C-Bitrix developers were faced with the fact that all public interfaces turned out to be disjointed. And only because there was no tool for creating a uniform interface. The solution was visual Grids - a set of kernel components to create a unified interface. What kind of Grids are these, what do you need to know about them? This is, first and foremost, a developer tool! This is not a custom component, so there is no point in adding it to the project page through the component tree. This is an API for the developer to present his data.


Multifunctional component for displaying lists

You may have a misconception about Grids that they can only display InfoBlocks. This is absolutely not true - Grids can work with abstract data and output everything that is “slipped” to them. Grids are also loaded with standard functionality for working with lists and forms. That is, what is a common point is made easier and simpler by grids. And one of the distinctive features of grids is that they provide quite wide customization opportunities for the user - “for themselves.” This means that each user can make his own Grid settings, which will be convenient only for him.


Setting up custom views

What does the general scheme of using Grids look like? Since Grids run on a public section, you will most likely create a component for the public section that presents data, sorts, filters, and so on. To present this data, you call the Grid component, the form component in your component template and simply pass the data from them for display. And, if necessary, you can use ready-made components, let’s say one of the simplest ones is the “toolbar”, which your toolbar displays with buttons.

Universal Lists

Grid components are implemented in 1C-Bitrix products, in particular, the Document Library in 1C-Bitrix: Corporate Portal uses grid components, and the Business Processes Without Documents module uses grids. All this allows you to use a unified interface with the same user settings and functionality. One of these modules, for which, in fact, the Grid “kitchen” was started, is the Universal Lists module. What kind of module is this?


List - Government of the Russian Federation

Tasks often arise to maintain data in a public section, and until now there have been no interfaces for this except, of course, the administrative one. The created module is an add-on for Infoblocks, organized as a public complex component and allows the user to enter their data in the form of a list. The component works with the specified type of Infoblock (the distribution shows "Lists"), this is set by default in the component settings. This means that all InfoBlocks created in this component will be added to this type.


Component settings - Infoblock type

You can also specify which user groups have the right to work with our universal lists. Let's say in the settings for the Administrator you can specify that he can change and add sections and list elements. But you can also grant this right to other groups of users, for example, company employees.


Lists, also known as Infoblocks

What do we see on the site? Essentially, a list of Infoblocks. That is, by adding a new list, for example, “Partners”, we add a new Infoblock. In this list-information block we can configure signatures and inscriptions for elements and sections of the list. For example, if we are talking about a list of partners, then “Add item” can be renamed to “Add partner”. The owner of the list can immediately determine access to his list: for some group - reading, for another - changing elements. Thus, you can immediately decide and set up the order of collective work with the created lists.

To start working with lists, you need to create a page, create an Infoblock type, place the “Universal Lists” component on the page, select the “Lists” infoblock type in it and start working.

The development plans for Lists in 1C-Bitrix products provide for the following:

Lower control over lists to the working group level, so that within the group you can work with your own lists;

So that you can independently create your own personal list in your profile. For now, in order to “create” lists on his page, the user must contact the administrator to place the component on his page and configure it, after which he can start working with the lists.


Setting list fields

What can you customize in the list? We have already talked about signatures and rights. And the most interesting thing is that you can customize the fields in the lists! Moreover, it should be especially noted that this is done in exactly the same way as you did in the administrative section in the Infoblocks. In this case, you can add both standard fields - such as “Name”, “Activity date”, and Infoblock properties, such as Number, Date, File, Link to Infoblock elements. You can also set default values ​​and use Infoblock sections.


Basic field settings

Let's see how the list is configured. Let's add some field. Let this be the date of last contact. We add a field, we say that it is Date\Time, we do not enter the default value - a field appears, for example, “Date of call”. Now we edit the list parameters and, accordingly, we have a new field of the “Date” type. As you can see, in this way we can flexibly customize our list, adding the fields that we need, and maintain, say, a register of some documents on the site.

As we have already said, the Lists module uses standard Grid capabilities, that is, it supports element sorting, element filtering, an element editing form, and group editing/deletion.

Lists + Business Processes

Another very interesting feature of Universal Lists is support for built-in Business processes. You probably don't have this in your public section yet. To include Business Processes in your lists, you must go to the administrative section in this Infoblock and enable Business Processes for it there.


Business processes in lists are enabled in the admin panel - in the properties of the information block

Using business processes allows you to organize quite serious things on lists. For example, in the register of incoming documents - the Counter property allows you to automatically number all documents, and you can open a business process that will send the final document to the executor, who will somehow react to this document. This way you can organize well-coordinated team work with lists.


Lists support business processes

Examples of using lists

The Universal Lists module is included in all editions of “1C-Bitrix: Corporate Portal” (www .1c -bitrix .ru /products /intranet /) - it is clear that it is needed there to maintain lists of some kind of internal order, for example, these can be lists of contacts with clients. In “1C-Bitrix: Site Management” (www.1c-bitrix.ru/products/cms/) the module is present in 3 senior editions, starting with Business. It is expected that the lists will be used, for example, to create private sections for business partners. In this case, partners will be able to maintain their confidential lists there. That is, we can organize an additional service for some site visitors.


Lists on the website of a government organization

You can give a more specific example - organize the reception of web forms on the site. Essentially, web forms become an input form into an information block element. In the administrative part, you manage various Infoblocks and, naturally, you do not want to allow different groups of users into the admin panel - only your content editors work there. However, it is necessary to give the opportunity, say, to the company’s partners to process data from these Infoblocks - to search through them, to add new records. Moreover, this needs to be done quickly, moreover, in the “public” - without, we repeat, going to the administrative department. This is where the ready-made mechanism of Universal Lists comes to the rescue, precisely allowing an existing InfoBlock with a large amount of accumulated data to be presented in the “public” and give the opportunity to search through it, filter information - in general, work with this data.

Let us remind you once again that Grids are a technology with which you can work with any of your data, with any source. For example, you take data from a MySQL project and organize the work on Grids - entering and processing this data. But Lists are already a practical solution “Grids + Infoblocks”. How are they connected? A list and an Infoblock are essentially the same thing - the same data, only accessible to an organization directly from the “public”.

So, with the help of Universal Lists, you can quickly create lists such as frequently asked questions on your web project. We emphasize once again - directly from the “public” - without going into the administrative panel! The visual universal list editor will help you quickly create and configure repositories of any type of information. And by using visual components that support drag&drop, you can do this easily. Moreover, you can not only enter data into storage, but also edit it.

Natalya Sergeeva for Softomania

We are currently implementing Bitrix24 for one large client. And for the last week we have been introducing into the life of the enterprise the accounting of various documents using universal lists in Bitrix24.

I would like to tell you in more detail about such a wonderful tool as universal lists.

In order to make it as clear as possible what they are, I will say that this client took into account all these points before Bitrix24 in MS Excel. Everyone roughly understands the functionality of Excel, if we consider it not for calculating some complex formulas, but as a log book. Some of the information is filled in as a text string (write whatever you want), some is calculated as a counter (a sequential number), something is selected from a pre-prepared list. All this Excel functionality is also present in Bitrix24 universal lists.

It is important to note that the number of lists is not limited, you can designate one for contracts, another for SIM cards issued to employees for corporate communications, the third for a register of material assets that are listed in your office (for example, tables, chairs, computers, etc. ).

We dedicated one of our client’s lists to accounting for contracts with counterparties.

So, a universal list is a list of elements, each of which consists of fields. Simply put, each element is an agreement (in the case of our client), and the fields of this element are important information about the agreement, its number, the name of the counterparty with whom this agreement was concluded, the amount, responsible persons, etc. For this particular client, the register of contracts consists of the following fields:

  • Contract number (text field in which the contract number assigned to it upon creation is entered);
  • contract date (when editing this field, a calendar opens in which you can select the desired date);
  • contract prefix (the contract prefix is ​​assigned depending on what product the contract is for, and when editing you are asked to select it from the list of prefixes);
  • No. add. agreements (a number is entered when editing);
  • scan a copy of the agreement (a file in any format containing a copy of the agreement on paper is attached);
  • Company (when editing, you are asked to select a company from those that are already in the CRM system, or add a new company, and when viewing, a link to the company card in the CRM appears).

This is not a complete list of fields that are used in this register of contracts. There are also employees who are somehow related to this agreement; they must be selected from the list of employees of the Bitrix24 portal. The “Created by” field is filled in automatically when a new item is created.

In the picture above you see the register of contracts of our client. We display all the fields that are important for us to see in the table through a special menu. This allows us to quickly obtain the information we need about the contracts that we have concluded, filter it, getting those contracts that are of interest now, and if the information from the table is not enough for us, we can go to the element and get it there.

Another important point is that, as in other sections of the portal, it is possible to flexibly set access rights both to the list as a whole and to each element separately.


To summarize, I would like to say that the total number of such lists for our client was 10. In them, he plans to take into account all the points necessary for business. They will always be at hand for those specialists who need this information. This will allow you to completely abandon Excel, which has disadvantages for organizing such work. Access to the excel file (it is available only over the local network, it is available to those who may not need this access, and if you put a password on the file, you must remember it, otherwise all data will be lost), search for the file (if everything is stored in excel, over time there are a lot of files and which file is needed in a given situation is sometimes not easy to understand), the file is easy to delete. Universal lists in Bitrix24 do not have all these shortcomings.

After introducing this tool into our client’s work, we decided to conduct a survey among the employees of this enterprise. And we were met with genuine positive emotions. Specialists who had to work on the lists due to their line of work gave only positive feedback, noting the ease of access and ease of use. One of the most popular points turned out to be that information about the agreement is available not only from the list itself, but also from the counterparty’s card you can always get acquainted with the list of agreements that were concluded with him.

Lists- a convenient tool for storing information with its own structure and fields. In addition, lists can be automatically processed using business processes.

Only an administrator can create lists.


Go to page Lists and press Create new.

Settings


In the tab Settings indicate the name of the list and its description.

Enter a sort value. The lower it is, the higher the list ranks among the rest. Add a picture for your listing.

If you plan to use business processes to work with lists, then activate the option Enable business process support.

Signatures


On the bookmark Signatures You can set your own names for elements and sections of the list. For example, if you are creating a list of Suppliers, then you should replace the word element with supplier, and the word section with group of suppliers, etc.

Access


Using a button Add select the desired group or specific user for whom you want to change access rights and set them.

  • No access- the list will not even be visible.
  • Reading- allows you to only view the list.
  • View in panel- viewing list items.
  • Addition- you can add elements to the list.
  • Adding to panels- you can add items to the list and view them.
  • Change- it is allowed to add elements and change the list, as well as launch business processes based on the list elements.
  • Change with restrictions- It is prohibited to add or remove sections of elements. Otherwise, all the same actions as for the rights to Change.
  • Full access- the full level of access rights to the list is set.

In order to explore additional possibilities of business processes, we will analyze the situation when your company receives a commercial proposal (CP) from a supplier, partner or any other counterparty.
First of all, we need to understand what to do with this document. To do this, we send it for approval to a competent employee (expert), who will make a decision on the future fate of the CP: it is either deleted, or saved to disk and entered into the register for further work, or, if the CP is considered useful, a deal is immediately created and work begins.



To automate this business process, you need to be able to work with lists.

IN There are 2 types of lists:

  • “Live Feed” lists (you can access them through “Processes in the Feed” or through “Live Feed”, the “More” button, then “Settings”).
We go into a specific process and see the list:


  • universal lists (section “Company”, item “Lists”)



*The main difference between universal lists and lists from the “Live Feed” is that the latter are focused on active work and discussion directly in the “Live Feed”. The necessary actions with the list can be performed directly from there.


We start working on the BP by creating two different lists:

  • "Coordination of CP"
    the “Live Tape” list, which will be used to coordinate the commercial proposal (CP).
  • "KP Register"
    Information is saved here in order to return to editing it later.

The difference between the first list “Approval of CP” is that an employee can quickly send a commercial proposal to the right expert for approval. Here you only need to set the necessary fields, namely:

  • KP name;
  • Responsible – to whom we send the business process;
  • Company name;
  • Date – filled in automatically upon creation;
  • KP file;
  • Comments;
  • Telephone;
  • Email;
  • Status is an auxiliary field where the result of a business process is displayed.



In the second list “KP Register” there are additional fields that allow you to save information that may be useful in the future:
  • The title is taken from the live tape;
  • Date of creation;
  • Responsible;
  • Transaction ID;
  • ID of the company we created;
  • Transaction amount.



Work with business processes is carried out through the “activity” option. Here we create a list element: in the “Document Type” field, select any of the lists that are on the portal. As a result, we see the fields that were specified in these lists. You can start filling them with data.




All files we work with are stored on Bitrix Disk.

* Bitrix Disk is the same data storage as disks on a PC. Accordingly, working with them is similar to what happens with disks on a PC, in Explorer.

What disks exist in :
  • Shared disk (section “Company”, item “Shared disk”) - available to all employees. It makes sense to store documents there that any employee may need (letter forms, contracts, etc.). The files here are visible to everyone;
  • Employee’s personal drive (section “Favorites”, item “My drive”). In addition to the files that the employee downloaded to the PC, you can also see files that are accessible from other places (for example, from the “Shared Drive” section). Files are only visible to you unless you set permissions for someone else;
  • A group disk is a separate storage area in which you discuss specific issues. In other words, you can upload files to this disk, create documents, but they will only be visible to those who are members of this group.
You can also run business processes on disk files, as well as create public links. The figure shows the entire list of “activities” for working with the disk:




Let's consider working with CP (2 development scenarios):
  • We go to the “Processes in the Ribbon” section, find the “CP Approval” list, the “Business Processes” button, go to the business process editor and create a sequential business process, which we will call: “CP Approval”. It will start automatically when the checkpoint appears (for this reason, we leave only the first checkmark at the top).
  • To find out what to do with the CP, it must be looked at by an expert. That is, in the document field we select the person responsible. We name the document “Choose what to do.” In the Description you can indicate the name of the CP, the date of creation and the necessary comments. Then we create a list of answer options for the expert:
  1. Reject;
  2. Think;
  3. Create a deal.
Click the “Install” button. Let the default be reject (really useful CPs don’t come across very often)




To request a file from a person, before sending the CP somewhere else, add a request for additional information in the “File” type field in the “activity” settings. Let's call it “Additional File” and select the “File” type. Click the “Save” button. In the same way, we find out the transaction amount: in the “activity” settings, select the necessary elements, fill in the fields, give the field name “Specify the transaction amount”, click the “Save” button.
  • Based on the expert’s answer, we set the condition: “What to do.” Then the options are: “Reject” - this action will be performed if the “What to do” variable is equal to the expert’s answer “Reject”. Here you can set the status “Rejected” in the list element to understand that the proposal was reviewed and found to be useless. Another option is "Think", that is, the value of the variable "What to do" is equal to "Think". So that all documents are in one place, we save them in a folder ("Activity" "Disk" section). Select “Download to Disk”, then “Save”.
  • We will transfer the information that is already in the live feed to the “KP Register” list, which we will supplement. Go to “Create Disk Items” in the “Document Processing” section, find “Activities”, open and select documents. Bitrix 24 immediately provides the necessary fields to fill out. We fill them out in the same way as we considered earlier (date, person responsible, etc.). Click the “Save” button.
The check can be carried out by going to the live feed, selecting the “Processes” and “KP Approval” sections.

Business processes and CRM

To work in CRM You will need the following sections (they can be found in the menu on the left):
  • Ribbon,
  • The main 4 entities: leads, contacts, companies, deals.
*Lead is the “germ” of a contact (CP, call, etc.). All preliminary information about the client is stored here, but he is not yet ready to proceed to the transaction stage. There is also a feed in which all events related to the lead are visible. You can make appointments, calls, fill out the necessary information. When more detailed information about the client has appeared, you can convert it into a company or contact. After this, if it is already necessary to conclude a deal, then the lead is converted into a deal and the work continues in this entity. Leads and deals have a status bar that shows at what stage the deal with this lead is.

There are several “activities” for CRM that allow you to create entities and track the stages of a transaction. When we work with business processes in a live feed, lists, on disks, we can only create some kind of CRM entity. If you need to work with data that will be stored in this entity, then business processes on the CRM itself are used. They are located in the “More”, “Settings” section, then “BP Automation”, that is, the same business process editor from where we will receive all the information that is available in a lead, deal, contact, company.

Let’s create an algorithm for the business process if the CP turns out to be useful and the company will enter into an agreement:




We go to the BP editor, “Processes in the feed”, “CP approval”, “Business process” and add one more condition - “Create a deal”.
The deal will be created with some company, for this we are creating a company. Go to CRM and select “Create a new company.” We fill in all fields.
After this, you can create a new deal. Fill in the same way: name, company, responsible, comments. Don't forget to save. In the list of business processes we indicate that the status has changed to “In progress”.




Now that the BP is completed, it will appear in CRM as a new deal.




We go into the created transaction and see: the company that we created, the amount of the transaction and the person responsible - all the data that we indicated. The power supply is working correctly.


Melekhova Svetlana

25.08.2014


Another interesting task arrived for me from the nasalnik. It is necessary to write a tool that allows you to copy universal lists for social groups (without content, just a diagram). As well as business processes belonging to this list.
Who's here? 0_0
It didn’t work out to pretend to be a piece of wallpaper, so I had to do it. And write an article, otherwise I’ll forget everything.

Today on discussion:

    1. copying universal lists for social groups
    2. copying business processes of these lists
The tool discussed can be found at the end of the article. True, you yourself must understand that I am not responsible for what you created with its help =)

Further:
  • BP - business process
  • CS - universal list (within the article, CS for social groups are meant)
  • IS - information block
  • KP - corporate portal
  • SG - social group
What is US?
Firstly, it took me some time to understand what exactly they wanted from me. In general, CP is still such a jungle for me =)
In order to show the work of thought, I will describe everything as it was.

First, we ask the admin for a test address and place a checklist there with the content.
Then we try to find out what the US is. After poking around the admin panel, I realized that this is a stupid information block and that you can work with it as an information block of a certain type. We've given up on copying the power supply for now; priority has been given to the lists.
On the test page we get a list of all information security, we understand that the type of information security for social groups is lists_socnet. At the same time we notice the presence of a field SOCNET_GROUP_ID, the value of which is equal to the SG ID; logical, right?

I’m trying to create an information block for a certain SG using a standard function we are used to CIBlock::Add(). I receive the created CS, which is shown in the SG public for editing. And creating properties manually comes later, directly in the tool.

Inspired by success, I begin to create the instrument itself. I don’t remember how to work with forms in a human way, so everything is done in Ajax.

Planning tool steps

The first step is to obtain the list of SGs. From these, the user selects the group from which the control system will need to be copied. This is done by the function CSocNetGroup::GetList() module socialnetwork.

The second step is to obtain the control system for the group specified in the first step. This is done using a standard infoblock function with a configured filter.
CIBlock::GetList(false, array("IBLOCK_TYPE_ID" => "lists_socnet", "SOCNET_GROUP_ID" => $chosen_id));

In the third step, we again show the list of SGs, only with the possibility of multiple selection. The user marks those groups where the CS specified in the second step should be cloned.

The further strategy is quite logical:

    1. we get a list of fields and properties of the control system
    2. for each SG specified in the third step, create an information block-US
    3. for each created control system we create the same properties as those of the original list using the CIBlockProperty class, which is usual for infoblocks, for working with properties
    4. at each step we log actions so that later we can beautifully show the sequence of actions =)
CList
We implement it, launch it, look at the admin panel - everything has been created beautifully, and happily rub our paws together. Now we go into the public domain and understand that the properties for the control system are not shown there.

I'm starting archaeological excavations. Located class C List with a bunch of kids. I swear with exquisite curses and watch how the work with the lists is going on.
But basically the same thing happens as when working with information blocks, only with its own add-on, which registers its tricks in the database. I won’t discuss why this was done now, although it is very interesting. In response to my complaints about this, my colleague Maxim said: “apparently, this was done to solve problems that are not obvious to us”. To which I received the answer that in Bitrix this phrase can be applied to almost any solution =)

In total, after the proceedings, I change the code of point three of the strategy: to create properties I use CList::AddField().
By the way, to get the values ​​of a property of the listing type I use the usual CIBlockProperty::GetPropertyEnum(). Since I didn’t have the task of processing anything other than strings and listings, I don’t specifically process other types (such as a file or a picture; an example of processing can be found in the code of the children of the class CList, I saw it there somewhere).

This time the properties appear in the public domain, and we move on to solving the problem of copying BPs linked to the control system.

Copying business processes
First of all, googling brings me to the topic of Copying business processes completely and individual elements. I don’t like the topic of exporting, it’s tricky, and even for hundreds of control systems it’s sad to do export manually, but programmatically it will take a couple of days to figure it out =) A hint on where to go the honest way: yes CBPWorkflowTemplateLoader::GetList(), but I really didn’t want to figure it out.

Therefore, we go the “dangerous” way from the topic - directly poking the database. Yes, you can shoot me, but I was limited in time to complete the task, so I went straight ahead. And the task is not the most standard.

Create a power supply manually and see what has changed in the table b_bp_workflow_template: a line was added where the field ENTITY installed in CIBlockDocument and the DOCUMENT_TYPE field has the value iblock_#ID#, where #ID#- US ID where the BP was created.

Let's return to the copy tool. In the third step, add a checkbox “copy also BP of the list”.

Adding points to the strategy

    1. find out which power supplies are tied to the control system
    2. copy the row in the table, reassigning DOCUMENT_TYPE for a newly created US
As a result, we got a Frankenstein tool. It works =)