Created
June 16, 2021 18:52
-
-
Save cgillis-aras/ec354b80f9bc368d03df917f9c834f3d to your computer and use it in GitHub Desktop.
Demonstrates how a single Method can be used both as a custom action and as a server event.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string actionName = this.getAction(); | |
string thisMethodName = "labs_CalculateDynamicDate"; // Set this to the name you are using for your method | |
if (actionName == thisMethodName) | |
{ | |
// If we get here, this is being used as a custom action, so switch to a get and return the results of that. | |
this.setAction("get"); | |
return this.apply(); | |
} | |
// If we get here, we are running in a server event, so just return this as normal | |
return this; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment