Показать сообщение отдельно
Старый 14.09.2017, 13:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,488 / 846 (79) +++++++
Регистрация: 28.10.2006
dynamicsaxinsight: AX7/D365/Operations: Enable/Disable form control in X++
Источник: https://dynamicsaxinsight.wordpress....n-x-plus-plus/
==============

Purpose:

The purpose of this document is to demonstrate how we can enable/disable a form control in X++ based on a business logic.

Product:

Dynamics 365 for Finance and Operations, Platform Update 9.

Development approach:

Customization through extension.

Development:
  1. Create a post event handler of a standard form method enabling/disabling the form controls. In this case, we are creating a post event handler of a standard method setFieldAccessHeader of SalesQuotationProjTable form.
  2. Please find the event handler method definition as follows.
[PostHandlerFor(formStr(SalesQuotationProjTable), formMethodStr(SalesQuotationProjTable, setFieldAccessHeader))]public static void SalesQuotationProjTable_Post_setFieldAccessHeader(XppPrePostArgs args){ FormRun sender = args.getThis(); FormDataSource salesQuotationTable_ds; SalesQuotationTable salesQuotationTable; salesQuotationTable_ds = sender.dataSource(1); salesQuotationTable = salesQuotationTable_ds.cursor(); sender.control(sender.controlId(formControlStr(SalesQuotationProjTable, DeviceUsageGroup))).enabled((salesQuotationTable.AMDeviceId) ? true : false);}


Источник: https://dynamicsaxinsight.wordpress....n-x-plus-plus/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.