A
A
AlexCruel2021-03-21 12:28:21
1C
AlexCruel, 2021-03-21 12:28:21

Is it possible to specify the name of the nomenclature through the code?

When creating an item (unloading from an ECXEL file), I cannot specify a category. That is, the nomenclature is created without a category.

НоваяНоменклатура = Справочники.Номенклатура.СоздатьЭлемент();
НоваяНоменклатура.КатегорияНоменклатуры = "Одежда";


I tried that, but it doesn't work.
НоваяНоменклатура.КатегорияНоменклатуры.Наименование = "Одежда";


What is the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sgr_A, 2021-03-21
@AlexCruel

According to your description, the attribute "Nomenclature category" has the type:

DirectoryLink.CategoriesNomenclature

And you are trying to "shove" a string into it :)
You need to pass a link to the "Nomenclature Category" directory element there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question