Forum Discussion
5 Replies
- christopher_gillisCommunity ManagerHello, Could you please clarify your use case for retrieving the name of the server event within the method itself? While it's not easily possible to directly get the name of the server event, it may be possible to infer which server event is currently running based on the information in the context item of the method. Chris ______________________________________ Christopher Gillis Aras Labs Software Engineer
- Former_MemberAccelerator IIII have a snippet of code that exists in a methods that is attached to two server events but only want to run it in one.
- Former_MemberAccelerator IIIA couple ways to check is by the "event" of the method...(beforeUpdate, beforeAdd, afterPromote, etc). There is an order of operation, i believe, as to what events get fired off first. If they are both the same event then you can look at the sort order. The execution of methods, as i understand it, goes in order per type. so lowest "sort order" goes first for each event example: onBeforeAdd_Method_1 - sort order 10 goes first onBeforeAdd_Method_1 - sort order 20 goes second etc... or, if you are able to, enable debugging and put a break point in each method. see what gets hit first. does this help?
- christopher_gillisCommunity ManagerHello, Could you please further elaborate on your use case? Which two server events do you need to distinguish between? Chris __________________________________ Christopher Gillis Aras Labs Software Engineer
- Former_MemberAccelerator IIII have figured out another solutions, thanks for the help.