Null value in extension class method

Hi All,

I have created the Post event handler for PurchFormLetter/main method… In that extension class, i am unable to the instance of PurchFormletter…It is my code…

[PostHandlerFor(classStr(PurchFormLetter), staticMethodStr(PurchFormLetter, main))]
    public static void PurchFormLetter_Post_main(XppPrePostArgs args)
    {
        AxFSAServicePartRequestQueue axFSAServicePartRequestQueue;
        #fsa
        PurchTable purchTable;
        PurchFormLetter purchformLetter = args.getThis() as PurchFormLetter;
        purchTable = purchFormLetter.parmSourceTable();
    }

Here i am getting null value for ‘purchformLetter’…

Please suggest…?

“this” isn’t applicable to static methods. If you want a reference to the PurchFormLetter object, you have to hook into an instance method.

By the way, why aren’t you using Chain of Commands instead of these ugly and error-prone XppPrePostArgs?

Thanks for your reply Martin…