Ideas.  Interesting.  Public catering.  Production.  Management.  Agriculture

1c general details in document forms. V8: History of attribute changes. "Data separation" property of a common attribute

The user's work with directories and documents in 1C consists of filling in the fields on the form.

1C details are the fields of the directory and the document that are displayed on the form for the user to fill them out.

Let us consider in detail the topic of details in 1C.

What is Requisites 1C

Each directory and 1C document consists of a set of fields. Such fields are called 1C details (for a 1C programmer).

In the configurator, in the 1C configuration tree, open any directory or document and you will see the Requisites branch. This is a list of details (fields) of the directory.

Take a look at how the same 1C details look on the 1C directory form.

Each 1C attribute has properties that indicate what type of value is stored in the attribute (string, number, etc.) and how the user will work with it.

Right-click on any 1C attribute and click Properties. A list of properties of the selected attribute will open in the window on the right.

The main properties of requisites 1C:

Standard details 1C

As you noticed, the reference form has 1C details that are not listed in the configurator: group, name, BIC.

In the list form of the directory, there are also 1C details that are not in the list: deletion mark.

These are standard requisites 1C. What it is? Each has a set of requisites 1C by default. For directories, this is, for example, a code and a name. For documents, this is the date and number.

Standard 1C details can be viewed as follows:

  • Go to the editor of the 1C object (reference book or document) by double-clicking on it
  • In the editor that opens, select the Data tab
  • Here you can set the standard details Code and Name of the directory
  • Click the button Standard details 1C to see the full list.

General details 1C

Starting with version 1C 8.2.14, a new Object 1C has appeared in 1C - General details 1C. With it, you can add an attribute (field) that will be present immediately in many directories and documents.

Properties of the general props 1C:

  • Auto-use - adds a common attribute 1C to all directories and documents at once
  • Composition - allows you to add the general attribute 1C only to the necessary directories and documents (auto-use then set to Do not use).

How to add props 1C

Right-click on the 1C Requisites branch of the desired directory and select Add.

We need to enter the Name of the 1C attribute, for example, “Office Address” and a synonym for “Office Address”. We leave the default type String, but check the box Unlimited length.

Let's add one more attribute 1C in exactly the same way, just select the Boolean type, let's call it "WorksOn Weekends".

How to display the details on the form 1C (thick client 1C)

Let's open the Forms branch of the same directory. To open the form, select the form of the element and double-click on it with the mouse.

Drag the mouse over the edge of the shape and stretch it (optional).

In the configurator panel, click the "Data Placement" button. You can also use the Form / Data Placement menu.

You see - our details are not displayed on the form. Put a checkmark on them. As well as the checkboxes Insert labels and Place automatically.

How to display details on the 1C form (1C thin client)

Let's open the Forms branch of the same directory. Select the shape of the element and double-click on it with the mouse.

On the Requisites tab, expand the Object line. You will see a list of details added earlier to the directory.

Now just drag the required attribute from the right window to the left window and it will appear on the form.

Form 1C details

In the thick client, the form has its own details. They are located on the Requisites tab.

These details are not stored in the database, but they can be used on the form for the fields that are needed to work with the form.

For example, you added a checkmark to a form. When you click on the form, something happens. The value of the checkbox is not important for you (you do not need to write it down) - it is only used to switch the form when working with it. In this case, you do not use the reference attribute as data, but the form attribute.

Periodic details 1C

In 1C version 7.7 there were periodic details. Their meaning is as follows: the value of the props is different on different dates. For example, the value for September 1 is one, and for October 1 is another. With the same props.

There are no periodic details in 1C 8. This is implemented as follows:

A shared prop is a prop that is added to multiple configuration objects and can also be used as component special data sharing mechanism:

  • Common props for multiple objects. An attribute that is present in several configuration objects in which this attribute retains its meaning and type. An example of such use: "Organization" attribute in regulated accounting documents in an application solution
  • Common requisite as an integral part of a special data sharing mechanism. This mechanism allows you to separate the work of the applied solution and all stored data into separate parts. At the same time, data separation is enabled for the common attribute.
    An example of such use: In one physical information base different "owners" of data work independently, while each user of such an application solution will have access only to his data

"Data separation" property of a common attribute

If this property is set to "Do not use", then the created configuration object will be used only as a prop that is part of several configuration objects.
If the property is set to "Separate", the common attribute will be used as the data separator

Composition of objects

The "Content" property of a common attribute determines the list of configuration objects that include this common attribute.
If the "Auto-use" property is set to "Do not use", the attribute will not be automatically added, and to select the objects in which you want to include the common attribute, you should use the "Composition" property.
Also, the "Composition" property should be used if, during the automatic use of a common attribute, there are objects in which the common attribute should not be present.

Using a shared prop

For each configuration object, the Usage column can take one of three values:
  • Automatic – means that the assignment of a configuration object to a common attribute depends on the value of the "Auto-use" property
  • Use - means that the configuration object is part of the general attribute
  • Do not use - means that the configuration object is not part of the general attribute
Thus, using the "Composition" property editor, you can selectively exclude some objects from the composition of a common attribute, despite the fact that "Auto-use" is set for it.

Configuration objects

A common attribute (not in data sharing mode) may include the following configuration objects:
  • Reference books
  • The documents
  • Document journals
  • Plans of types of characteristics
  • Calculation Type Plans
  • Business processes
  • Tasks
  • Information registers
  • Accumulation registers
  • Accounting registers
  • Exchange Plans
  • External data sources

Peculiarities

When writing a document, the general attribute of the journal is assigned the value of the general attribute of the document or NULL if the document is not part of the general attribute
The general attribute can be used in data access restrictions. It makes sense to include external data sources in the composition of a common attribute if the common attribute is a separator.

ADVICE! General attributes should not be used to describe data that is part of the business logic of specific objects.

In 1s 7.7, directories had interesting requisites - periodic, they could remember the value of the requisite with reference to time, it was not very convenient to work with them, but, for lack of alternatives, they had to. After switching to 8-ku, many programmers were surprised to find the absence of periodic details in the directories.

Typical tasks that are solved using periodic information registers are the storage of information with reference to time. The information can be heterogeneous, such as the prices for the nomenclature, and the positions occupied by the employee in different periods of time, and the parameters of the tax accounting of the enterprise. In 8, periodic registers are reduced as an analogue of periodic details.

In order to repeat the functionality of 7.7, you need to do the following:

Create a register summarized "Periodic Counterparty Data", indicate that this is a periodic register of information with a frequency of a day.

Now we need to add on the tab "Data" - the dimension "Counterparty" a type that matches the reference book in which we want to implement a functionality similar to the periodic attribute. In the "Details" branch, we add those details, the data that is tied to time. For a counterparty, this can be a legal and physical address, the main phone number, the name of the manager, the main fax, etc.

After saving the configuration, you can access the information register through the side menu (in managed application mode), see screenshot.

In normal application mode, via the "Go" button

But if we look at the completed register, we will notice that it is rather difficult to understand what information is relevant, since we see the entire data set as a whole, and not just the current one. this moment information.

When there is a lot of information, it is easy to make a mistake, it is advisable to show up-to-date information in the counterparty card. This is where programming is indispensable.

To begin with, let's add a group to the form, which we will call "Contact details", we will add two details "Head" and "Phone" to it


And in the form module, on the “On Opening” event, we will hang actions to receive up-to-date data:

& On Client Procedure On Opening (Failure) //Insert in the sampler data= MinActualData() ; attempt Director = dani. kerivnik; exception end of try ; attempt phone = data. telephone; exception end of try ; EndProcedure

The function for getting actual data is as follows:

function AmountActualDate() //Insert in the sampler //((REQUERY_CONSTRUCTOR WITH_RESULT_PROCESSING // Dan's fragment of prompts by the constructor. // If the constructor is revisited, manually entered changes will be spent!!! Request = New Request; Request. Text = " SELECT | Periodic Counterparty DataSlice of Recent. counterparty, | Periodic Counterparty DataSlice of Recent. Kerivnik, | Periodic Counterparty DataSlice of Recent. Addresses, | Periodic Counterparty DataSlice of Recent. Telephone |FROM | RegisterInformation. Periodic Data of the Counterparty. Latest Slice AS Periodic Counterparty DataSlice Latest|WHERE | Periodic Counterparty DataSlice of Recent. Contractor = & Contractor" ; Query. SetParameter(" Account " , object. Reference) ; Query Result = Query. Execute () ; SamplingDetailRecords = QueryResult.Select() ; data= new structure; While SamplingDetailRecords. Next() Loop // Insert a sample selection selectionDetailRecords //SelectionDetailedRecords.Ker_vnik; data. Insert(" ker_vnik " , SelectionDetailRecords. kar_vnik) ; data. Insert(" phone " , SelectionDetailRecords. Phone) ; Report(SelectionDetailRecords. Phone) ; EndCycle ; Data return; //)) REQUEST_CONSTRUCTOR WITH_RESULT_PROCESSING End function

I used the query, although it can be used for these purposes with a less cumbersome construction:

selection = new structure; selection.Insert("Account", object); data = information registers.ContactInformation.GetLast(, selection); report(data.Ker_vnik); report(data.Quantity());

Please note that in the function GetLatest two parameters are passed, a moment in time and a selection, but if we need at the current moment, then the first parameter can be omitted, in the selection, the name of the key must match the value of the register dimension.

The main thing is not to forget to set the appropriate checkboxes in the register on the “Other” tab

If you look, then the periodic information register is a much more flexible tool compared to the periodic details in 7.7. In typical configurations, it is widely used.

General props in 1C 8.3 is a platform metadata object that allows you to use one attribute for many configuration objects (directories, documents, charts of accounts, etc.). The object was created mainly to facilitate the work of the developer and the separation of data.

General details were originally implemented in version 1C 7.7, but the developers did not immediately include it in platform 8 of version. The mechanism of common details was introduced by 1C developers only in release 8.2.14.

General attributes are very convenient to add in order not to change the standard objects in the configuration, I often use them along with .

After adding a common attribute, it can be used in queries and displayed on the form of objects − outwardly, it is no different from the usual props.

The only limitation of common attributes is that they cannot be used in .

Let's consider the main settings and properties of common attributes that are different from other configuration objects:

Compound— a list of objects for which the common attribute will be used, the setting resembles the setting of the exchange plan.

Get 267 1C video lessons for free:

Auto use— the setting determines whether a common attribute will be used for those objects that have the "Automatic" usage mode specified in the composition.

Data separation We will consider this setting separately.

Separation of data in 1C using a common attribute

Data separation- a mechanism similar to the mechanism. However, the performance of this mechanism is more efficient, and it is easier to configure.

The mechanism allows you to configure the display of only elements that the user can see. For example, you can distinguish between all objects (documents, directories, etc.) where a certain organization is installed.

Setting up data separation using common 1C details

To set up in the general attribute, you must specify the data separation − Divide. Immediately after clicking, the system will prompt you to create default accounting parameters:

In this case, it will be necessary to specify session parameters at system startup, how to do this, with an example, it was described in the article.

This completes the setting - the user will only have access to the information that is specified in the selected session parameters.

An example of using a common attribute

Let's analyze the setting of the general props in 1C 8.3 using the example of a wireframe configuration and props Organization:

There are 3 documents in the system, where it is necessary to indicate the requisite Organization: these are Invoice Invoice, Expenditure Invoice, Payroll.

The setup is simple:

  1. Create a new General attribute, specify the type — DirectoryLink.Organization.
  2. In the composition we arrange for our documents - Use.

Everything, the setup is over!

Let's see the result:

The system displays the common attribute “as its own”: both in requests, and in form attributes, and in other places. This is such magic! 🙂

General props 1C 8.3 are not added

Loading...