Источник:
https://www.tech.alirazazaidi.com/ho...nd-operations/
==============
Today is small tip,Many times, we have to took decision based on the name of menu on which form is called. By getting menu namewe can use same form for different purposes. We can write logic based on current form called from which menu item.
Following is thecode snippet helps you to achieve this.
[FormEventHandler(formStr(LogisticsContactInfoGrid), FormEventType::Initialized)] public static void LogisticsContactInfoGrid_OnInitialized(xFormRun sender, FormEventArgs e) { FormRun formRun = sender; if (formRun.args().menuItemName() == "CustomerLogisticsContactInfoGrid") { FormDataSource LogisticsElectronicAddress_ds =formRun.dataSource("LogisticsElectronicAddress"); LogisticsElectronicAddress_ds.InsertIfEmpty(true); LogisticsElectronicAddress_ds.object(fieldNum(LogisticsElectronicAddress, Locator)).mandatory(true); }
Источник:
https://www.tech.alirazazaidi.com/ho...nd-operations/