Bookshelf Home | Contents | Index | PDF |
Pricing Administration Guide > Script-Based Pricing Factors > Sample ScriptThe following sample script is presented as a learning tool. It may not function properly in your environment. This example shows a very simple pricing script that demonstrates the process of passing information to and from the script. function Service_PreInvokeMethod (MethodName, Inputs, Outputs) // Field 1 Customizable Product Header.Account // Field 2 Customizable Product.Name // Parameter 3 Customizable Product XA.Color var account = Inputs.GetProperty ("Var 1"); var Product = Inputs.GetProperty ("Var 2"); var Color = Inputs.GetProperty ("Var 3"); var CurrentPrice = Inputs.GetProperty ("Current Price"); var curPrice = parseFloat (CurrentPrice); if (account.indexOf("Siebel") > -1) reason = "20% markup for Siebel. "; Outputs.SetProperty ("Script Applied", "true"); if ((Product == "Shirt") && (Color == "Red")) // note that this is 10 of whatever currency is being used Outputs.SetProperty ("Script Applied", "true"); CurrentPrice = curPrice.toString(); Outputs.SetProperty ("Current Price", CurrentPrice); |
Pricing Administration Guide |