I’m new in X++. Can anyone explain why we need super command in our coding ? Can provide a very simple example when super() need to be use ?
Because u want to use method/function already defined in class but with some modification.
Hi Sam,
In brief -super() method is usually used to override system method of base object.
For example - validateWrite() method on table. Pseudo code -
…
boolean ret;
;
ret = super();
//Some condition below
if (<condition 1> == <condition 2>)
ret = true;
else
ret = false;
return ret;
In above method, first line (ret = super()) will call standard system validation. Subsequently that is overridden by calling some validation.
Hope this gives you an idea.
Regards,