Добрый день!

Прошу помощи. Необходимо добавить новую деталь в раздел "Контрагенты" - Страны в которых представлена компания (аналогично детали участники активности раздела "Активности) с возможностью выбора нескольких значений из справочника Страны.

Действия:

- Создал объект - UsrContrCountry, указал родительский объект "Базовый объект". Добавил колонку USrContrContryColumn с указанием справочника страна.

- Создал карточку детали UsrContrCountryPage, указал зависимость от объекта UsrContrCountry. Вставил код сгенерированный с помощью NUISchemaGenerator (в качестве объекта выбран для генерации выбран объект "Страны в которых представлена компания (UsrContrCountry):

define('UsrContrCountryPage', ['ext-base', 'terrasoft', 'sandbox',
'UsrContrCountry', 'UsrContrCountryPageStructure', 'UsrContrCountryPageResources', 'GeneralDetails'],
function(Ext, Terrasoft, sandbox, entitySchema, structure, resources, GeneralDetails) {
structure.userCode = function() {
this.entitySchema = entitySchema;
this.name = 'UsrContrCountryCardViewModel';
this.schema.rightPanel = [
GeneralDetails.File('UsrContrCountry'),
GeneralDetails.Notes('Notes', {
collapsed: false
}),
GeneralDetails.InFolder('UsrContrCountry')
];
this.schema.leftPanel = [
{
type: Terrasoft.ViewModelSchemaItem.GROUP,
name: 'baseElementsControlGroup',
visible: true,
collapsed: false,
wrapContainerClass: 'main-elements-control-group-container',
items: [ {
type: Terrasoft.core.enums.ViewModelSchemaItem.ATTRIBUTE,
name: 'UsrContrCountryColumn',
columnPath: 'UsrContrCountryColumn',
dataValueType: Terrasoft.DataValueType.TEXT,
visible: true
}]
}
];
};
return structure;
});

- Добавил схему представления детали с реестром UsrContrCountryDetail, указал зависимость от UsrContrCountry, вставил код сгенерированный NUISchemaGenerator:
define('UsrContrCountryDetail', ['ext-base', 'terrasoft', 'UsrContrCountry', 'UsrContrCountryDetailStructure',
'UsrContrCountryDetailResources'], function(Ext, Terrasoft, entitySchema, structure, resources) {
structure.userCode = function() {
this.entitySchema = entitySchema;
this.name = 'UsrContrCountryDetailViewModel';
this.editPageName = 'UsrContrCountryPage';
this.columnsConfig = [
{
cols: 10,
key: [
{
name: {
bindTo: 'Id'
},
type: 'title'
}
]
}
];
this.loadedColumns = [
{
columnPath: 'Id'
}, {
columnPath: 'Id'
}
];
this.methods.setEntitySchema = function() {
this.entitySchema = entitySchema;
};
};
return structure;
});

- Прошу помощи в написании кода для вставки в замещающую страницу раздела Контрагенты.
При попытке генерации через NUISchemaGenerator ошибка:

Exception Message: У схемы "UsrContrCountry" не указана первичная отображаемая колонка
Exception Type: Terrasoft.Common.NullOrEmptyException
Exception Source: Terrasoft.Core

Пробовал следующий:

structure.userCode = function() {

this.schema.rightPanel.push({
name: 'UsrContrCountry',
schemaName: 'UsrContrCountryDetail',
type: Terrasoft.ViewModelSchemaItem.DETAIL,
caption: resources.localizableStrings.UsrContrCountryDetailCaption,
visible: true,
collapsed: true,
leftWidth: '60%',
rightWidth: '40%',
wrapContainerClass: 'control-group-container'
});
};
return structure;

Версия BPMonline 7.3.0.2388.
Спасибо.

Нравится

1 комментарий

Здравствуйте!
В первую очередь хочу отметить, что начиная с версии 7.3 изменился формат описания клиентских схем, и NUISchemaGenerator не применим. Использование этого модуля актуально для версий до 7.3. Это же касается и статей на старом SDK.
Поэтому написанный Вами код не будет корректно работать.
Прошу Вас обратить внимание на уже реализованные страницы и детали в базовой версии, возможно это поможет Вам в решении задачи. В 7.3 почти все модули страниц, разделов и деталей имеют окончание "V2" в названии. Например, страница контрагента назвается "AccountPageV2" и т.д.
Вопросы добавления детали, к слову, уже на обсуждались на комьюнити, например:
http://www.community.terrasoft.ru/forum/topic/10857
http://www.community.terrasoft.ru/forum/topic/10704

Прилагаю небольшое описание принципов работы с конфигурацией в 7.3
dok_po_7.3.docx

Показать все комментарии