X++ |
C# | |
abstract |
||
class |
The modifiers public and private are ignored on class declarations.
There is no concept of a namespace grouping of classes. There are no dots (.) in any class names. |
The modifiers public and private can be used to modify class declarations. C# also has the keyword internal, which relates to how classes are grouped together in assembly files. |
extends |
A class declaration can inherit from another class by using the extends keyword. |
A colon (:) is used where the key words extends and implements are used in X++. |
final |
A final method cannot be overridden in a derived class. A final class cannot be extended. |
The keyword sealed on a class means the same thing that final means on an X++ class. |
implements |
A class declaration can implement an interface by using the implements keyword. |
(See extends.) |
interface |
An interface can specify methods that the class must implement. |
An interface can specify methods that the class must implement. |
new |
The new keyword is used to allocate a new instance of a class. Then the constructor is automatically called.
Each class has exactly one constructor, and the constructor is named new. You can decide what parameters the constructor should input. |
The new keyword is used to create a new instance of a class. Then the constructor is automatically called.
Constructor methods themselves are not named new; they have the same name as the class.
|
null |
||
private and protected |
The private and protected keywords can be used to modify the declaration of a class member. |
The private and protected keywords can be used to modify the declaration of a class member. |
public |
A method that is not modified with public, protected, or privatehas the default access level of public. |
A method that is not modified with public, protected, or private has the default access level of private. |
static |
A method can be static, but a field cannot. |
Both methods and fields can be static. |
super |
The super keyword is used in a derived class to access the same method on its base class.
void method2()
{
;
// Call method2 method
// on the base class.
super();
} |
The base keyword is used in a derived class to access various methods in its base class.
void method2()
{
// Call methods on
// the base class.
base.method2();
base.method3();
} |
this |
For a call from one instance method to another on the same object, a qualifier for the called method is required. The keyword this is available as a qualifier for the current object. |
For a call from one instance method to another on the same object, a qualifier for the called method is not required. However, the this keyword is available as a qualifier for the current object. In practice, the keyword this can be helpful by displaying IntelliSense information. |
finalize |
The Object class contains the finalize method. The finalize method is not final, and it can be overridden.
The finalize method appears to resemble the System.Object.Finalize method in C#, but in X++ the finalize method has no special meaning of any kind.
An object is automatically removed from memory when the last reference to the object stops referencing the object. For example, this can happen when the last reference goes out of scope or is assigned another object to reference. |
The methods Finalize and Dispose are common on some types of classes.
The garbage collector calls the Finalize and Dispose methods when it destroys and object. |
main |
Classes that are invoked from a menu have their main method called by the system. |
Classes that are invoked from a command line console have their Main method called by the system. |
Adding a calculated field to a grid
Enterprise Portal 개발을 진행하면서, AX Grid에 어떻게 하면 Calculated Field를 표시해 줄 수 있을까를 고민하면서 찾은 방법입니다.
첫번째 사용한 방법은 AX 2012에서 새롭게 소개된 View 의 Computed Field를 추가해서 사용하는 방법을 이용했지만, 다른 문제가 있음을 발견 후 다시 고민고민을 하다가 결국 오늘 두번째 방법을 찾았답니다.
두번째 방법은 이미 X++ 개발을 하셨던 분들에게는 쉬운 방법일 수 있겠지만, 저처럼 C#을 접하고 X++을 개발하는 개발자에게는 조금은 생소한 방법이기 때문에 다른 분들과의 공유를 위해서 이곳에 기록을 남겨 봅니다.
이미 만들어져 있는 VendInvoiceTrans 테이블의 display method인 lineAmountInclTax를 Grid상에 표시하는 방법입니다.
1) VendInvoiceTrans 테이블의 lineAmountInclTax display method
2) Grid –> New Control –> RealEdit Type의 칼럼 추가
3) DataSource, DataMethod 를 각각 아래와 같이 변경
4) Enterprise Portal 상에서 추가된 칼럼 정보 확인
A) Grid에서의 칼럼 순서 표기
B)앞의 Amount는 새롭게 추가된 lineAmountInclTax 칼럼이며, 뒤의 Amount는 기존의 LineAmount칼럼임
'Dynamics AX' 카테고리의 다른 글
Employee Services (0) | 2013.10.09 |
---|---|
Dynamics AX 2012 R2: Improved Office Interop capabilities (0) | 2013.10.08 |
Comparision between X++ and C# (0) | 2013.10.05 |
Dynamics AX Hotfix 적용전 확인 사항 (0) | 2013.09.24 |
Item의 Default Order Settings 일괄 생성 (0) | 2013.09.24 |