1

Is it possible or how to access method variable on Chain of Command? Please see code for visualization.

//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?
        }
    }

I need to get the salesFormLetter variable for me to do additional business logic to add/update records on customized table.

rjv
  • 1,058
  • 11
  • 29
Bryan
  • 1,245
  • 5
  • 22
  • 37

1 Answers1

4

There is no way to achieve this. You need to use another method to add your logic, e.g. the run method:

[ExtensionOf(classStr(SalesFormLetter))] 
final class KTI_DRD_SalesFormLetter_Extension 
{
    public void  run()
    {
        next run();

        // put your logic here
        this.myMethod();
    }
}
Aliaksandr Maksimau
  • 2,251
  • 12
  • 21