P
P
Pepper12017-11-25 10:03:07
1C
Pepper1, 2017-11-25 10:03:07

How to implement balance control in 1C?

I am studying the implementation of the control of residues in 1C, I do it with all the examples, but the results are even. Help, tell me what's wrong?
Documents: Getting the Tutorials and Implementing
the Tutorials Tabular parts: Tutorials
Accumulation register : Tutorials Remains
The code runs without errors, but does not display the rest.
Here is the code:
Procedure Handling(Failure, Mode)
Movements.Remainder of Tutorials.Write = True;
For Each TechStringTutorials From Tutorials Loop
Movement = Movements.RemainingTutorials.Add();
Movement.MovementType = MovementTypeAccumulation.Expense;
Movement.Period = Date;
Movement.Tutorials = TekStringTutorials.Name;
Movement.Quantity = CurrentStringTutorials.Quantity;
EndCycle;
If Mode = PostingDocumentMode.Online Then
Request = New Request;
Query.Text = "
CHOOSE
| Remainder of TutorialsRemainders.Tutorials ,
| Remaining TextbooksRemains.QuantityRemaining |
FROM
|
| Implementation of TutorialsTutorials.Name.Link = &Link)) AS Remainder of TutorialsRemains
|
RemainderTutorialsRemainders.QuantityRemainder < 0";
Query.SetParameter("Reference", Reference);
QueryResult = Query.Execute();
SamplingDetailRecords = QueryResult.Select();
While SamplingDetailedRecords.Next() Loop
Report(SelectionDetailRecords.Quantity());
EndLoop;
Report(Mode); Report(SelectionDetailRecords.Quantity());
EndIf;
EndProcedure

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Kinash, 2017-11-25
@Dementor

What does "results are even" mean?
From what I see (as I understand it, this is the module of the document object Implementing Textbooks, and what is happening in the document object module Getting Textbooks and the record set module of the register Remains of Textbooks remains unknown) I want to note a few points:
1) It is not customary to write a call to the Report() method in object modules . And not only because it is outdated and not recommended for use (you need to use the UserMessage object instead), but because there is no 100% chance that this message will be shown and read - for example, when a scheduled task is running.
2) If online posting is disabled for your document, then the block in the condition "Mode = Document Posting Mode. Online" will not be executed.
3) Your logic is missing a motion set record before the request is executed. Command "Movements.RemainingTextbooks.Write = True;" says only that at the end of the procedure for recording from the Motion property. The rest of the Tutorials must be written to the database. But, if you want to check the changed state in the database with a query, then the postings should be recorded explicitly using the Write () method before that.

D
Dimonchik, 2017-11-25
@dimonchik2013

forum-1c.ru

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question