Answer the question
In order to leave comments, you need to log in
How to set the visibility of a group in the 1s form if the directory data is not predefined?
I can’t make the group visible in the 1c form, this is how it turns out with predefined data from the directory.
Элементы.ГруппаКомиссия.Видимость = (Объект.ВидНоменклатуры = Справочники.ВидыНоменклатуры.АксесуарыФЛ);
Элементы.ГруппаКомиссия.Видимость = (Объект.ВидНоменклатуры.Родитель = Справочники.ВидыНоменклатуры.Наименование("Телефон"));
Answer the question
In order to leave comments, you need to log in
Open the syntax assistant, go through the sections:
Application objects - Catalogs - CatalogManager.<CatalogName> - Methods - FindByName
and see there...
CatalogManager.<Directory name> (CatalogManager.<Directory name>)
FindByDescription (FindByDescription)
Syntax:
FindByName (<Name>, <ExactMatch>, <Parent>, <Owner>)
Parameters:
<Name> (required)
Type: String.
A string containing the search name.
<ExactMatch> (optional)
Type: Boolean.
Specifies the full match search mode.
The search will be successful if the search string: if the parameter value is False - will match the left part of the name; if the value of the parameter is True, it will completely match the name (except for "tail" spaces in the name).
Default value: False.
<Parent> (optional)
Type: DictionaryLink.<Directory name>.
The parent within which to search. If not specified, then the search will be carried out in the entire directory.
<Owner> (optional)
Type: DirectoryReference.<Directory name>.
The owner within which to search. If not specified, then the search will be carried out in the entire directory.
Return value:
Type: DirectoryLink.<Directory name>; Undefined.
Link to the found directory element.
If no element with the required name exists, a null reference will be returned.
If the directory name is not specified (length = 0) and the search is performed by full match, then Undefined will be returned.
Description:
Searches for an element by its name.
Availability:
Server, thick client, external connection, mobile application (server).
Note:
If there are multiple elements with the specified name, only one of them will be found.
Example:
СтрокаНаименования = "USD";
Валюты = Справочники.Валюты;
НайденнаяСсылка = Валюты.НайтиПоНаименованию(СтрокаНаименования);
Если НайденнаяСсылка = Валюты.ПустаяСсылка() Тогда
Сообщить("Валюты """ + СтрокаНаименования + """ еще нет");
КонецЕсли;
It is obvious that it does not work out "Directories. Types of Nomenclature. Name ("Phone")".
And this kind of coding is bad style. And not only because of the possibility of changing the name by users. Why is it not necessary to specify a commission for phones? Is there a more precise sign (rate, classifier code, etc.)? Precisely, only one group will be hidden for the whole life of the company and there will never be new groups?
It is better to enter the sign "No commission" and by this sign from the nomenclature, or from its type, or from their groupings, further hide blocks. If we are talking about a managed interface, then we need to consider using visibility control by functional options.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question