Get the value of the 1s attribute 8.3. A document can be in three states

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

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

Let's take a closer look at the topic of details in 1C.

What are 1C Details

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 Details branch. This is a list of directory details (fields).

Look 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.

Main properties of 1C details:

Standard 1C details

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

The directory list form also contains 1C details that are not in the list: deletion mark.

These are standard 1C details. What it is? Everyone has a default set of 1C details. For directories this is, for example, code and 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 (directory or document) by double-clicking on it with the mouse
  • In the editor that opens, select the Data tab
  • Here you can configure the standard details Code and Name of the directory
  • Click the 1C Standard Details button to view the full list.

General 1C details

Starting with version 1C 8.2.14, a new 1C Object has appeared in 1C - General 1C Details. Using it, you can add a property (field) that will be present in many directories and documents at once.

Properties of general 1C attributes:

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

How to add 1C details

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

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

Let’s add another 1C attribute in the same way, only we’ll select the Boolean type and call it “Works on Weekends”.

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

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

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

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

You see that our details are not displayed on the form. Check them. And also the Insert labels and Place automatically checkboxes.

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

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

On the Details tab, expand the Object line. You will see a list of details that were previously added to the directory.

Now just drag the required attribute from the right window to the left one 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 Details tab.

These details are not saved 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 the form. When you click it, something happens on the form. The meaning of the checkbox does not matter to you (you do not need to write it down) - it is used only to switch the form when working with it. In this case, you do not use the directory attribute as data, but the form attribute.

Periodic details 1C

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

In 1C 8 there are no periodic details. This is implemented as follows:

General details 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 make the developer's work easier and to separate data.

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

It is very convenient to add general details so as not to change standard objects in the configuration; I often use them along with .

After adding a general attribute, it can be used in queries and displayed on the object form - Outwardly, it is no different from ordinary props.

The only limitation of general details is the inability to use them in .

Let's look at the basic settings and properties of general details that differ from other configuration objects:

Compound— a list of objects to which the general details will be used; the setting is reminiscent of setting up an exchange plan.

Get 267 video lessons on 1C for free:

Auto use— the setting determines whether general props will be used for those objects that have the “Automatic” usage mode specified.

Data separation— we will consider this setting separately.

Separation of data in 1C using common details

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 general 1C details

To configure the general details, you need to specify the data separation - Divide. Immediately after clicking, the system will offer to create default accounting parameters:

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

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

Example of using common props

Let's look at setting up general props in 1C 8.3 using the example of a frame configuration and props Organization:

The system has 3 documents where it is necessary to indicate the details of the Organization: these are the Receipt Invoice, the Expenditure Invoice, and the Payroll.

The setup is simple:

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

That's it, the setup is complete!

Let's see the result:

The system displays general details “as if they were your own”: in requests, in form details, and in other places. This is such magic! 🙂

General requisites 1C 8.3 are not added

A common attribute is an attribute that is added to several configuration objects, and can also be used as part of a special data sharing mechanism:

  • Common props for several objects. An attribute that is present in several configuration objects in which this attribute retains its meaning and type. An example of such use: The “Organization” attribute in regulated accounting documents in an application solution
  • General attributes as an integral part of a special data separation mechanism. This mechanism allows you to divide the work of the application solution and all stored data into separate parts. In this case, data separation is enabled for the general attribute.
    An example of such use: Different “owners” of data work independently in one physical information base, while each user of such an application solution will only have access to his data

Property "Data separation" of the general attribute

If this property is set to "Do not use", then the created configuration object will be used only as an attribute included in several configuration objects.
If the property is set to "Separate", the common attribute will be used as the data separator

Composition of objects

The "Composition" property of a general attribute determines the list of configuration objects that include this general attribute.
If the "Auto-Use" property is set to "Do not use", the automatic addition of props will not occur, and to select objects in which you want to include common props, you should use the "Composition" property.
Also, the “Composition” property should be used if, when using the common attribute automatically, there are objects in which the common attribute should not be present.

Using common props

For each configuration object, the Usage column can take one of three values:
  • Automatically – means that the assignment of a configuration object to a general attribute depends on the value of the "Auto-Use" property
  • Use - means that the configuration object is part of the general attribute
  • Not used - 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 the general props, despite the fact that “Auto-use” is set for it.

Configuration Objects

The general attribute (not in data sharing mode) may include the following configuration objects:
  • Directories
  • Documentation
  • Document logs
  • Characteristic type plans
  • Calculation type plans
  • Business processes
  • Tasks
  • Information registers
  • Accumulation registers
  • Accounting registers
  • Exchange plans
  • External data sources

Peculiarities

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

ADVICE! You should not use general attributes to describe data that is part of the business logic of specific objects.

This article will consider such a concept as 1C documents, what kind of configuration object it is, what its purpose is, what customizable properties exist for the object; how you can work with this object interactively and programmatically.


The life of any enterprise is not possible without recording various types of events that occur very often. These events are called - business transactions. The registration of a business transaction in 1C is a document.

Examples of business transactions: receipt of goods at the warehouse, write-off of goods from the warehouse, receipt of funds at the cash desk, hiring of an employee, etc.

All these transactions must be documented in appropriate paper documents. The document object registered with the 1C system is precisely an analogue of this paper document. It should be noted that we have at least two different accounts. These are management accounting and regulated accounting. In regulated accounting, a business transaction cannot exist without a document confirming it. In management accounting, the presence of a document for a business transaction is not a prerequisite, since the list of transactions performed in management accounting can be varied. In this case, some information is simply recorded in the form of an electronic document.

So we have a paper document and an electronic document. An analogy must be made between them. When issuing a paper document, it is necessary to include a number and date. Likewise, the electronic document must contain the number and date. Using these fields we can find the document we need. Therefore number and date are key properties.

Let's consider the key property "Date of". In version 7.7 it was called "DataDoc", in version 8 it became simply called "Date of". This is a very important property of the document. Why is this so? Let's consider the situation with a trade organization in which the fact of receipt of goods and its sale is registered. So, it is not possible to sell a product whose receipt date is greater than the sale date, because it is impossible to sell a product that has not yet arrived.

Note that in some standard configurations it is possible to sell goods that have not yet arrived. But this is the exception rather than the rule and relates to the specifics of the trading enterprise.

This is precisely why having a date on a document is so important. It should also be noted that in the property "Date of" contains not only the date, but also the time of the document accurate to the second.

Very often, such identification of a document on the time axis is not enough.

Let's imagine a situation where 100 units of goods arrive at the warehouse on the 1st of the month. Then on the 2nd of the same month at 23:59:59 it is sold in the amount of 80 units. The document is carried out without problems, because there is enough goods. Let’s say that on the 2nd at 23:59:59 someone else also sells the same product in the amount of 50 units. This document will also be processed without problems, because at the time of 23:59:59 this product is available. Although in fact, as a result of the second document, we have a negative balance of 30 units of goods.

To prevent such situations from arising, the position of the document, namely its link, is also added to the date and time. This document identification by date and time + link is called moment of time. And when posting the second document, the system will display a message about a shortage of 30 units of goods and will not allow posting the document.

How to get a moment in time? And it turns out by the method "Moment of time", belonging to the class "DocumentObject". The data type returned is "Moment of time".

This type of data must be passed to requests that receive the remaining product as a parameter.

An example of getting a point in time:

&OnClient Procedure GetTimePoint(Command) GetTimeTimeOnServer(Object.Ref) ; EndProcedure &OnServer Procedure GetTimePointOnServer(Link) If Link. Empty() Then Report( "The document was not recorded!") ; Return ; EndIf ; DocumentObject = Link. GetObject() ; Moment of Time = DocumentObject. Moment of time() ; Report(TimePoint); End of Procedure // GetTimePointOnServer()

Setting document time

Let's look at how the system sets a time stamp for newly entered documents. When creating a document, the current system date with zero time is assigned by default, and when writing, the current timestamp is set.


When performing surgery, there is the following nuance. If its date is equal to the current one, the time will take on the current time. If the document were posted non-operatively, then only at the moment of its entry the current time stamp would be assigned, and then it would remain unchanged. If the document is not entered with the current date, then a zero timestamp is initially assigned, and when recording, the latest timestamp for that day is assigned. That is, the system looks for the last entered document for that day, looks at its time, increases it by a second and assigns it to our document. If you create a document for a date on which no document of this type was entered (for example, receipt of goods), but documents of another type were entered (for example, write-off of goods), then the system will take the most recent date of a document of another type, add a second to it and assign it to our document. If you create a document with a date in which no document of any type has been entered, then the platform will assign it the time 12:00:00.

And another situation. Let's imagine that we have a document in the database with a time stamp of 23:59:59 and if we add one more second it will be the next day. Therefore, the system leaves the same time, that is, 23:59:59. The document time setting system described above is only a default value. But it is possible to override this behavior. Let's open the document form in the configurator and turn to its properties. In the properties we will see a field "AutoTime". If we do not change anything in this property, then the document time is generated as described above. But you can specify the time: current or at the beginning of the day, always first, always last, and not use.

Another key property of a document is number. The document number, like the date, is a required property of any document. It is necessary to identify the document from the printout.

Possibility of carrying out

A document can have three states: created, marked for deletion And carried out. A posted document can change the financial condition of the enterprise, change the number of goods in the warehouse, etc. That is, an unposted document is a kind of draft, but when it is posted, it comes into force and accordingly registers some event. The 1C system makes it possible to change a posted document, cancel its execution, which, unlike Western analogues of programs, is a softer principle of accounting.

Standard document details

In addition to the details that the developer adds to the document, there is also a standard set of details embedded in the document at the platform level. This: link, number, date, deletion mark, carried out. You can find them on the bookmark "Data", button "Standard details".

We have already talked about the number and date. The deletion mark is a Boolean attribute containing information about whether the document is marked for deletion or not. Link- attribute intended for unique identification of a document in the table of documents. Conducted- a Boolean property containing information about whether the document has been posted or not.

A document can be in three states:

  • Not marked for deletion and not carried out;
  • Not marked for deletion and carried out;
  • Marked for deletion and not carried out.

As noted earlier, the developer can independently add the necessary details, as well as tabular parts. Each table part has one standard attribute - "LineNumber".


Storing documents in the information base

In the database, each type of document is stored in a separate table. This table contains all the details of the document. Table parts are stored in separate tables. Communication with the table of documents is made using the details "Link".

Numbering of documents

Each document has a number, the settings of which are set on the tab "Numbering". On this tab, you can set the automatic numbering feature, the uniqueness control feature, specify what type of number the number will be (numeric or string) and its length.

It is recommended to set the number type to string, because in the future you may need to indicate the organization prefix in the number, which happens very often.

The prefix is ​​set in the document object module, in the procedure "When Installing a New Number".

Procedure When Installing a New Number (StandardProcessing, Prefix) End of Procedure

Also on the tab "Numbering" we can set the frequency of the document.

Possible values:
  • Non-periodic;
  • Within a year;
  • Within the block;
  • Within a month;
  • Within a day.
Usually choose the value "within a year", this means that in the new year the numbering of documents will start all over again.

Sometimes situations arise when continuous numbering is necessary for several types of documents. For these cases, the system provides such an object as a numerator.

It must be indicated in the field "Numerator".

Carrying out documents

A little about document processing. For the system it means that the document is posted if the Boolean flag "Passed" the document is set to "True". In the general list, such documents are highlighted with the corresponding icon. This means nothing more for the platform, but from the point of view of the logic of the program, the completed document can affect the financial result of the company. That is, it can generate movements according to registers, based on which reports are generated.

When an interactive or programmatic execution occurs, the execution of the procedure is triggered "ProcessingConduct()", which is in the document object module.

// Insert the contents of the handler. End of Procedure

This procedure has two parameters: refusal And mode. If you set the failure parameter to "True", then the posting will not be performed. Parameter "Mode" establishes the document processing mode - operational or non-operative. The developer must register the movements in the registers themselves in this procedure independently.

The registers in which the document will make movements is set on the tab "Movements".

Example of a transaction processing procedure

ProcessingProcedure(Failure, Mode) // This fragment is built by the constructor. // When reusing the constructor, manual changes have been made // will be lost!!! // register GoodsInStock Arrival Movements. ProductsInStock. Write = True ; For Each TechString Products From Products Cycle Movement = Movement. ProductsInStock. Add() ; Movement. Movement Type = Accumulation Movement Type. Coming; Movement. period = date; Movement. Product = TechStringProducts. Product; Movement. Quantity = TechStringProducts. Quantity; EndCycle ; //__CONSTRUCTOR_MOVEMENT_REGISTERS End of Procedure

Access rights to documents

There are different types of access in the 1C system. These are interaction analysis and program action analysis.

What are interactive activities? These are actions performed directly by the user: pressing buttons, checkboxes, etc. Software actions are performed by some algorithm; the user may not even be aware of their execution.

Document access rights are configured on the tab "Rights". Here we see several sections, this is the section where roles are displayed, the section directly for rights, and the section "Data Access Restrictions"(we will not consider it; it is necessary when using the so-called RLS mechanism).

Chapter "Roles" displays all roles created in the information base, for which in the section "Rights" We just set access rights.

Possible types of access rights:
  • reading (programmatically), viewing (interactively);
  • append (programmatically), interactive append (interactive);
  • change (programmatically), edit (interactively);
  • delete (programmatically), interactive delete (interactive);
  • conducting (programmatically), interactive conducting (interactively);
  • cancellation of execution (programmatically), interactive cancellation of execution (interactively);

The interactive type of access also contains the following rights: interactive marking for deletion, interactive unmarking for deletion, interactive deletion of marked ones, interactive non-operational posting, interactive change of posted entries, line entry.

Tabular part of the document

The tabular parts of the document are specified on the tab "Data" and are nothing more than collections, the elements of which are the rows of the tabular part. Therefore, traversing its elements is possible both by a loop and by direct access by index (numbering starts from zero).


Share with friends or save for yourself:

Loading...