Есть класс в котором прописан диалог
X++:
protected Object dialog(DialogRunbase _dialog, boolean _forceOnClient)
{
DialogGroup dialogGroup;
FormBuildDataSource formBuildDataSource;
FormBuildGridControl formBuildGridControl;
FormBuildStringControl formBuildStringControl;
FormBuildRealControl formBuildRealControl;
FormBuildCheckBoxControl formBuildCheckBoxControl;
DialogGroup dlgGroup;
DialogGroup dlgGrpVisibleSpecifications;
DialogGroup dlgGrpVisibleNomenklatures;
#define.GridControlWidth(800)
#define.GridControlHeight(120)
;
_dialog = Dialog::newFormnameRunbase(formstr(TranscriptMCDialog_ZTR), this);
dialog = super(_dialog, true,true);
dialog.caption(this.caption());
dialogGroup = dialog.addGroup("");
dialogGroup.columns(2);
_transscriptFld = dialog.addFieldValueEx_ZTR(typeid(RMZId_ZTR),_rmzId);
_transscriptFld.allowEdit(false);
_itemIdFld = dialog.addFieldValueEx_ZTR(typeid(ItemId), _itemId, '@SYS72708', '@SYS72708',false, '_ItemIdFld');
_itemIdFld.valueMustExist_ZTR(DialogFieldValueMustExist_ZTR::Yes);
_itemIdFld.allowEdit(false);
_itemNameFld = dialog.addFieldValueEx_ZTR(typeid(ItemName),_itemName);
_itemNameFld.allowEdit(false);
_addNodeFld = dialog.addFieldValueEx_ZTR(typeid(NoYes), _isAddNode, "Создать новую строку", "Создать новую строку",false,'_addNodeFld');
_numFld = dialog.addFieldValueEx_ZTR(typeid(RmzBomItemNum),_num,@"Добавить узел в строку", @"Добавить узел в строку",false,'_NumFld');
_numFld.valueMustExist_ZTR(DialogFieldValueMustExist_ZTR::Yes);
_numFld.mandatory_ZTR(1);
_numFld.displayLength(30);
_numFld.enabled(!_isAddNode);
_addNodeFld1 = dialog.addFieldValueEx_ZTR(typeid(NoYes), _isAddNode, "Новый объект", "Новый объект",false,'_addNodeFld1');
dlgGrpVisibleSpecifications = dialog.addGroup("@SYS3076");
dlgGrpVisibleSpecifications.frameOptionButton(FormFrameOptionButton::Hide);
dlgGrpVisibleSpecifications.optionValue(_bomVisible);
dlgGrpVisibleSpecifications.hideIfEmpty(false);
formBuildDataSource = dialog.form().dataSource(3);
formBuildDataSource.autoQuery(true);
formBuildDataSource.autoSearch(false);
formBuildDataSource.table(tablenum(TmpBOMWrkTreeBom_ZTR));
formBuildGridControl = dialog.curFormGroup().addControl(FormControlType::Grid, "ItemsGrid");
formBuildGridControl.dataSource(formBuildDataSource.name());
#if.GridControlWidth
formBuildGridControl.width(#GridControlWidth, -1);
#endif
#if.GridControlHeight
formBuildGridControl.height(#GridControlHeight, -1);
#endif
[B] formBuildDataSource.counterField(fieldnum(TmpBOMWrkTreeBom_ZTR, DataType));
formBuildRealControl = formBuildGridControl.addDataField(formBuildDataSource.id(), fieldnum(TmpBOMWrkTreeBom_ZTR, DataType));
formBuildRealControl.autoDeclaration(noyes::Yes);
// formBuildRealControl.visible(false);[/B]
formBuildDataSource.counterField(fieldnum(TmpBOMWrkTreeBom_ZTR, Num));
formBuildRealControl = formBuildGridControl.addDataField(formBuildDataSource.id(), fieldnum(TmpBOMWrkTreeBom_ZTR, Num));
formBuildRealControl.name("Num");
formBuildRealControl.width(70);
formBuildStringControl = formBuildGridControl.addDataField(formBuildDataSource.id(), fieldnum(TmpBOMWrkTreeBom_ZTR, ItemId));
formBuildStringControl.lookupButton();
formBuildStringControl.width(150);
formBuildStringControl.name("ItemId");
formBuildStringControl = formBuildGridControl.addDataField(formBuildDataSource.id(), fieldnum(TmpBOMWrkTreeBom_ZTR, ItemId));
formBuildStringControl.dataField(0);
formBuildStringControl.dataMethod("ItemName");
formBuildStringControl.width(200);
formBuildRealControl = formBuildGridControl.addDataField(formBuildDataSource.id(), fieldnum(TmpBOMWrkTreeBom_ZTR, QtyCoeff));
formBuildStringControl.name("QtyCoeff");
formBuildStringControl = formBuildGridControl.addDataField(formBuildDataSource.id(), fieldnum(TmpBOMWrkTreeBom_ZTR, WrkCtrIssueId));
formBuildStringControl.name("WrkCtrGroupId2");
formBuildStringControl.width(150);
formBuildStringControl.label("Цех выпуска");
formBuildRealControl = formBuildGridControl.addDataField(formBuildDataSource.id(), fieldnum(TmpBOMWrkTreeBom_ZTR, bomSchemeCode));
formBuildStringControl.name("SchemeCode");
dlgGrpVisibleSpecifications = dialog.addGroup("@ZTR5737");
dlgGrpVisibleSpecifications.frameOptionButton(FormFrameOptionButton::Hide);
dlgGrpVisibleSpecifications.optionValue(_itemVisible);
dlgGrpVisibleSpecifications.hideIfEmpty(false);
formBuildDataSource = dialog.form().dataSource(2);
formBuildDataSource.autoQuery(true);
formBuildDataSource.autoSearch(false);
formBuildDataSource.insertIfEmpty(false);
formBuildDataSource.table(tablenum(TmpBOMWrkTreeNotUsedItems_ZTR));
formBuildGridControl = dialog.curFormGroup().addControl(FormControlType::Grid, "NotUsedItemsGrid");
formBuildGridControl.dataSource(formBuildDataSource.name());
#if.GridControlWidth
formBuildGridControl.width(#GridControlWidth, -1);
#endif
#if.GridControlHeight
formBuildGridControl.height(#GridControlHeight, -1);
#endif
formBuildRealControl = formBuildGridControl.addDataField(formBuildDataSource.id(), fieldnum(TmpBOMWrkTreeNotUsedItems_ZTR, Num));
formBuildRealControl.name("NotUsedItemsNum");
formBuildRealControl.lookupButton(FormLookupButton::Always);
formBuildRealControl.width(100);
formBuildStringControl = formBuildGridControl.addDataField(formBuildDataSource.id(), fieldnum(TmpBOMWrkTreeNotUsedItems_ZTR, ItemId));
formBuildStringControl.width(150);
formBuildStringControl = formBuildGridControl.addDataField(formBuildDataSource.id(), fieldnum(TmpBOMWrkTreeNotUsedItems_ZTR, ItemId));
formBuildStringControl.width(200);
formBuildStringControl.dataField(0);
formBuildStringControl.dataMethod("ItemName");
return dialog;
}
на DialogField _addNodeFld1 навешан modified.
Можно ли при изменении значения в addNodeFld1 менять автоматически значение в поле грида - DataType.
Все DataSource укзаны в самой форме, которую вызывает этот класс.