Bookshelf Home | Contents | Index | PDF |
Siebel Analytics Web Administration Guide > Administering Siebel Answers > Blocking Requests in Siebel Answers > Blocking Requests Based on FormulaSiebel Answers provides a hook to create and incorporate a JavaScript validation function that is called from Siebel Answers when a user enters or modifies a column formula. If the call fails and returns a message, Siebel Answers displays the message and cancels the operation. Additionally, helper functions are available so the query blocking function can check for filters, columns, and so on, rather than traversing the DOM manually. For more information on the helper functions, read Validation Helper Functions. The criteriatemplates.xml file includes a message named kuiFormulaBlockingScript that can be overridden to include JavaScript that defines a validateAnalysisFormula function. By default, this message contains a function that always returns True. Siebel Answers calls validateAnalysisFormula before applying changes made by the user. If the function returns True, the formula is accepted. If the function returns False, the formula is rejected. Otherwise, the return value from the function is displayed in the message area beneath the formula, as it does currently when an invalid formula is entered. The user has the option to click OK to ignore the error. To display your own alert and allow the user to continue, your function should return True. To block the query, return False or a message. Your function should investigate the formula passed to it using JavaScript string and regular expression techniques for validation. The following code example shows a sample custom message. <?xml version="1.0" encoding="utf-8"?> <WebMessage name="kuiFormulaBlockingScript" translate="no"> </WebMessageTable> The following code example shows blocking based on the formula entered. // This is a formula blocking function. It makes sure the user does not enter an unacceptable formula. // we don't allow the use of concat || in our formulas // no case statements please // Check for a function syntax: aggrule(formula) aggrule should not contain a '.' |
Siebel Analytics Web Administration Guide |