2

All of my codes are in extensions.

I've added a field into the table, and also added that field into the assigned field group.

Now it is visible on my Design.

enter image description here

and I want to place a code into the event of it where it is modified.

enter image description here

So I've created a new class, then get the event handler.

enter image description here

But when I paste it, there's an error and I checked the intelisense and it can't see the field I placed, well in fact, it is there:

enter image description here

enter image description here

How can I use my newly added field? Is there something I am missing?

m1gs
  • 197
  • 2
  • 17

2 Answers2

0

I can reproduce this problem in Platform Update 8. It seems to be a limitation of the product when working with controls added through field groups.

Nevertheless the solution is simple - use Modified event of the datasource field, not the individual control. That's what you should do in most cases anyway, because one field may be displayed at several places, but it should do the same thing when modified from either of them.

Martin Dráb
  • 259
  • 1
  • 7
0

You can use the registerExtensionInstance method as described in this blog post and register override of the required control's method from method new.

You can see how the registerExtensionInstance pattern is used in a number of classes in AX:

  • CaseDetailEventHandler
  • DirPartyQuickCreateFormApplicationSuiteEventHandlers
  • EssWorkspaceFormExtensionAppSuiteEventHandler
  • EssWorkspaceFormExtensionExpenseEventHandler
  • FormControlQuickPersonalizationTileExtension
  • HCMCaseDetailCreateEventHandler
  • HCMCaseDetailEventHandler
  • HcmCaseDetailEventHandler_HcmWL
  • HcmEnrollmentDateManagerFormExtensionEventHandler
  • HcmJobFormExtensionRetailHandler
  • HcmPositionActionDetailFormExtensionPayrollHandler
  • HcmPositionDateManagerFormExtensionPayrollHandler
  • HcmPositionFormExtensionPayrollHandler
  • HcmPositionMassUpdateFormEventHandler
  • HcmWorkerDateManagerFormExtensionPayrollHandler
  • HcmWorkerEnrollmentFormExtensionPayrollEventHandler
  • HcmWorkerFormExtensionPayrollHandler
  • HierarchyDetailEventHandler
  • HRMCourseInstructorFormExtensionAppSuiteHandler
  • smmActivitiesEventHandler
  • smmContactPersonFormApplicationSuiteEventHandlers
  • SysGenBlankWorkspaceOptionsPowerBIExtension
10p
  • 5,488
  • 22
  • 30