Let us discuss some specifics of document posting procedures that check the availability of materials in warehouses.
This check is not required all the time. It is required for real-time document posting and not required for regular document posting. So what are real-time and regular posting modes intended for? And how does real-time posting work?
The development of 1C:Enterprise configurations involves the concept of real-time and regular document posting. This concept helps to solve tasks related to real-time accounting, such as inventory accounting, and ensures proper document processing in real-life conditions. But you can disable this feature (forbid real-time document posting) and implement your own algorithms that determine the document order on the timeline and perform other posting-related operations.
This concept implies that users can work in two fundamentally different modes.
Real-time document posting is performed in real-time, in other words, it reflects the current changes and facts. Real-time posting is particularly relevant when multiple users work with a single application. Therefore, for this posting mode you need to implement the maximum number of checks to prevent errors when accepting user input.
For example, in the real-time posting you need to monitor the on-hand balances for listed products in order to prevent a single item from being sold simultaneously by multiple sales reps.
During the real-time posting the platform first compares the document date with the current session date. The current session date is the computer system date converted to the session time zone. If the date of the document being posted matches the current date, the platform posts the document in real-time mode. The event handler is capable of getting the posting mode, so it can select the appropriate posting algorithm.
If the date of the document being posted is before the current date, the document is posted in regular mode.
Regular posting means that the facts that took place in the past or are certain to happen in the future are reflected in the database. Therefore, regular document posting is intended to simply reflect data on completed operations in the Infobase.
For regular posting, many checks do not make sense, especially the balance checks. Naturally, if mistakes were made during regular document posting (such as issuing a number of products not available in the warehouse on the posting date), analysis of the resulting database state is a separate task, unrelated to regular posting and performed independently of that process. Instead, this process takes place when the database has sufficient data for analysis, for example, when earlier goods receipt documents are entered.
Hence real-time posting is intended to determine whether an operation can be executed in real-time in a multiuser environment (and execute the operation if possible). By contrast, regular posting is intended for unconditional recording of operations that are already completed or will certainly be completed to the database.
Sometimes you might want to post a document with some date in the future in order to reflect some events that are certain to happen in the future. In this scenario the platform does not allow posting the document with a future date if the document is allowed to use real-time posting. You will be warned that real-time posting is not available for this document without any other options to choose from. So you will either need to change the document date to the current date (and then you can post the document in real-time mode), or to a date in the past (and then you can post the document in regular mode). So if the accounting logic suggests that some documents should be posted with a date in the future, real-time posting mode should be disabled for this document in the metadata (on the Posting tab of the configuration object editor).
The concepts of "real-time timestamp" and "point in time" are related to real-time document posting. We will not use this information right now but this is a good chance to discuss it because we are talking about real-time posting.
Next page: "Point in time" concept