是否可以或如何在命令链上访问方法变量?请查看代码以进行可视化。
//Standard class
abstract class SalesFormLetter extends FormLetterServiceController
{
static void main(Args _args)
{
SalesFormLetter salesFormLetter;
//standard business logic here
}
}
//Class extension
[ExtensionOf(classStr(SalesFormLetter))]
final class KTI_DRD_SalesFormLetter_Extension
{
static void main(Args args)
{
next main(args);
//how can I get the salesFormLetter variable used on base method?
}
}
我需要获取salesFormLetter变量,以执行其他业务逻辑以在自定义表上添加/更新记录。
答案 0 :(得分:4)
没有办法实现这一目标。您需要使用其他方法来添加逻辑,例如run
方法:
[ExtensionOf(classStr(SalesFormLetter))]
final class KTI_DRD_SalesFormLetter_Extension
{
public void run()
{
next run();
// put your logic here
this.myMethod();
}
}