Bookshelf Home | Contents | Index | PDF |
Siebel Analytics Web Administration Guide > Administering Siebel Answers > Blocking Requests in Siebel Answers > Blocking Requests Based on CriteriaWhen a user attempts to execute a request that your code blocks, you can display an error message, and the request will not be executed. The answerstemplates.xml file includes a message named kuiCriteriaBlockingScript that can be overridden to either define or include JavaScript that defines a validateAnalysisCriteria function. By default, this message contains a function that always returns True. It should be overridden using the procedures described in Customizing the Siebel Analytics Web User Interface Using XML Message Files. Siebel Answers calls your validateAnalysisCriteria function when the user tries to execute the request. The function can return True if the request is not blocked, or False or a message if the request is blocked. If a message or a value other than False is returned, the message is displayed in a popup window. In either case, the query is blocked. The following code example shows the blocking of a query. <?xml version="1.0" encoding="utf-8"?> <WebMessage name="kuiCriteriaBlockingScript" translate="no"> </WebMessageTable> Sample blocking script in .../SiebelAnalyticsData/web/Res/myblocking.js // This is a blocking function. It makes sure users pick what I want them to. // Create the helper object // Validation Logic if (!tValidator.dependentColumnExists("Markets","Region","Markets","District")) // If validation script notifies user, then return false if (!tValidator.dependentColumnExists("Sales Measures","","Periods","Year")) if (!tValidator.filterExists("Sales Measures","Dollars")) if (!tValidator.dependentFilterExists("Markets","Market","Markets")) var n = tValidator.filterCount("Markets","Region"); If you do not override the function using the template as described previously, or if the function returns anything other than False, the criteria is considered to be valid and the request is issued. The criteria is validated using this same mechanism for preview and save operations as well. |
Siebel Analytics Web Administration Guide |