Note to ExtensionOf attribute, final keyword and _Extension suffix to the name of class.
[ExtensionOf(tableStr(CustTable))]
final class CustTable_Extension
{
public str formatedName()
{
return strFmt('[%1] %2', this.AccountNum, this.name());
}
}
And here example how to call extension class.
public static void main(Args _args)
{
CustTable custTable;
select firstonly custTable;
info(custTable.formatedName());
}
And here example how to call extension class. The same we can do to class. Just change ExtensionOf attribute. Here we are extending MainClass.
[ExtensionOf(classStr(MainClass))]
final class MainClass_Extension
{
public void sayHello()
{
info("Say hello from extension class");
}
}
Here you can read more details.
No comments:
Post a Comment