Answer the question
In order to leave comments, you need to log in
How to select a field from a query?
Have a request
Query.Text =
"SELECT
| Nomenclature Prices.Nomenclature.Parent,
| Nomenclature Prices.Nomenclature.DescriptionFull,
|Nomenclature Prices.Price
|FROM
| Information Register.Nomenclature Prices AS Nomenclature Prices";
While SelectionDetailRecords.Next() Loop
NewRecord = New Structure("Parent, Name, Price");
NewRecord.Parent = String(SelectionDetailedRecords.Nomenclature.Parent);
NewRecord.Name = String(SelectionDetailedRecords.Nomenclature.NameFull);
NewRecord.Price = String(SelectionDetailedRecords.Price);
DataArray.Add(NewRecord);
EndCycle;
Answer the question
In order to leave comments, you need to log in
1. put a debugging point. This will help you see what you can refer to in the SampleDetailRecords and what names there are.
well, or look in the request
2. what do you select in the request? Is there any mention of nomenclature? You choose the Parent and NameFull, so write them SamplingDetailedRecords.Parent, SamplingDetailedRecords.NameFull.
Make aliases to the fields and refer to them. For example:
ВЫБРАТЬ
| ЦеныНоменклатуры.Номенклатура.Родитель КАК Родитель
Since there are no aliases in the query, the fields in the SamplingDetailRecords will be called "Nomenclature Parent" and "NomenclatureDescriptionFull". In general, they wrote it correctly above - it was necessary to put a breakpoint after While SelectionDetailedRecords.Next() Loop and see what is in the selection
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question