Managing user exits
When creating user exits, make sure that the script follows the required source code template or signature to enable the application to recognize and execute them.
These scripting languages are supported:
- C# script
- JavaScript
These are source code templates or signatures for each language:
- C# script
//Unique Id for the Script, use GUID var Id = "9d43880a-2eb8-445d-a1c9-8dc189758882"; //Display Name for this User Exit Script var Name = "UserExit using C# Script"; //Description for the Script var Description = "This is a UserExit using C# Script"; //Expect this value is passed from script //var Args = new Dictionary<string, object>(); //Retrieve and assign a parameter to a variable. var htsCode = Args.ContainsKey("Style_HTSCode")?Args["Style_HTSCode"].ToString():string.Empty; var result; //return the value. return result;
- JavaScript
var Id, Name, Description, Args Id = "9d43780a-2eb8-425d-a1c9-8dc189758878"; //Unique Id for the Script, use GUID Name = "UserExit using JavaScript scripting"; //Display Name for this User Exit Script Description = "This is a UserExit using JavaScript scripting"; //Description for the Script Args = []; //This will hold the parameters //This Execute() method is called everytime you run a UserExit, do not remove. function Execute() { var result; //return the value. return result; }