When writing code in X++ you sometimes need to reference this.functionYouWant()
and sometimes it is element.FunctionYouWant()
. Sometimes both are in scope. I often try one and if the function I want isn't there I try the other. Is there a rule that explains when to use this
and when to use element
?
相关问题
- How can I identify an Axapta class Name from the c
- How to hide enum values on a combo box at runtime?
- catching the warning message from aif web service
- How can you create a simple dialog box in Dynamics
- Updating a salesorder using AIF
相关文章
- CRUD operation in AX tables using C#
- How to create a lookup with fields from more than
- Table Update Event Handler
- Execute .exe in SSRS Report
- Nested notExists joins X++ (Dynamics AX3.0)
- Obtain Network Credentials from Current User in Wi
- View details control on ax 2012 form
- Update records that can be retrieved by multiple j
this
can be used in any objects to reference the current object and member methods.MorphX forms and reports are composite objects.
In forms the collection of objects is contained within a
FormRun
object. You can reference members in the outerFormRun
object by using theelement
reference.If your code is placed at the top level there are no functional difference between
this
andelement
.If your code is placed in a FormDataSource
this
will reference the datasource butelement
will reference theFormRun
."This" can be used only refers to the same class objects but "element" is access the form methods into any form level(like datasouce level,design level)if the functionality of method is same we can use