web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :

Post event handler of class method. #D365 #dynamics

Krishna Bhardwaj Profile Picture Krishna Bhardwaj 97

I'll demonstrate how to use a class method's post event handler, make use of parameters and a class buffer, as well as how to get the return value and set our own return value.

//This is DemoClass which contains isItemIdOk() method.

class DemoClass

{

        public boolean isItemIdOk(ItemId _ItemId)

        {

                boolean ret = false;

                If (_ItemId)

                {

                        ret = true;

                }

                return ret;

        }

}

//Post event handler of isItemIdOk() method

 [PostHandlerFor(classStr(DemoClass), methodStr(DemoClassisItemIdOk))]

 public static void DemoClass_Post_isItemIdOk(XppPrePostArgs args)

{

        DemoClass demoClass = args.getThis();  //Get class

        ItemId  itemId= args.getArg(identifierStr('_itemId')); //Get parameter 

        boolean ret =  args.getReturnValue(); //Get return value

        ret = false;

        args.setReturnValue(ret);  //Set return value

}

Comments

*This post is locked for comments