Bookshelf Home | Contents | Index | PDF | ![]() ![]() |
Siebel Advisor API Reference > Callout Point Functions for Siebel Advisor > COP_BeforeDisplayPriceStringUsageThis allows you to manipulate the HTML string before it appears in the Pricing window. Whatever changes you make to the original string 's' must be returned by this function. In other words, the end of this function must contain a 'return s' or whatever variable was chosen to hold the HTML string. SyntaxCOP_BeforeDisplayPriceString(PriceObj, s, cols, font, body, title, table, close) ExampleThe following sample code uses COP_BeforeDisplayPriceString to replace the Close Window text with an image. function COP_BeforeDisplayPriceString(PriceObj, s, cols, font, body, title, table, close) { return s.replace(/Close Window/,"<img src='"+GetUIPath()+"close.gif' border=0>"); The following sample code displays the child pricing objects in indented format. The default pricing display is just the parent object. The ACME Sedan is the parent object. The Automatic Transmission, Air Conditioning and Stereo Upgrade are children (and they are indented). The CD Changer is a child of the stereo upgrade so it is further indented. For more information on parent/child modeling, refer to the Referencing Other Siebel Data chapter in Siebel Advisor Administration Guide. The sample code, which should be placed at the end of custom/customCode.js: function COP_BeforeDisplayPriceString(PriceObj, s, cols, font, body, title, table, close) { if (typeof PriceObj != "undefined" && PriceObj != null) { var s = "<html><head><title>"+title+"</title></head><body "+body+">"; s += DisplayRow(PriceObj, cols, font); // only display the close link if it is defined and if in a window (not frame) if (close != "" && dispFrame == false) s += "<br><br><a href='javascript:void(0)' onclick=self.close()>"+close+"</a>"; // DisplayRow displays the PriceObj data as specified in cols. The depth determines how far to indent the description. // Recursively displays all of the children and grandchildren. function DisplayRow(PriceObj, cols, font, depth) { if (depth == null) {depth = 0}; var children = PriceObj.GetChildren(); for (var i=0;i<cols.length;i++) { if (typeof PriceObj.GetField(cols[i]) != "undefined") { // indent only the first field indent += " " s += "<td><font "+font+">"+indent+PriceObj.GetField(cols[i]) // check for children objects, if exist, display them. |
![]() ![]() |
Siebel Advisor API Reference | Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Legal Notices. | |