6Customizing a SmartScript User Interface
Customizing a SmartScript User Interface
This chapter describes how to customize the user interface of a SmartScript. It includes the following topics:
About Customizing a SmartScript User Interface
Siebel SmartScript provides a flexible user interface that allows modification. The answer controls that determine whether an answer appears as a text box, drop-down list, or pick applet are determined by values in the question definition. See Fundamentals of Creating SmartScripts for more information on working with questions.
Two other important ways in which the SmartScript user interface is designed are listed as follows:
SmartScript’s implicit page break rules determine whether certain questions appear on a given page.
SmartScript’s HTML formatting capabilities allow you to determine how pages display to users in terms of layout, typography, and other graphical elements.
Determining which questions you want to appear on the same page is a design decision that involves many factors. You have to consider a question’s relationship to questions that precede and follow it, the need for branching logic, and many other requirements. In addition to the rules and design decisions you explicitly apply within a script to organize questions into pages, Siebel SmartScript applies rules that determine whether a question can appear on a given page. For example, if the definition of a question includes a certain type of VB event, the question might have to appear on the next page. To get the results you want, you must allow for and work with these implicit page-break rules.
Siebel SmartScript allows you to apply and modify HTML formatting code to determine the way question and page data displays. You can work with HTML formatting as follows:
To enhance the typography or graphic display associated with an individual question, you use HTML code within the question Translation text.
To change the design and layout of the page, you work with the HTML template.
Controlling the Questions Displayed on a Page
It is often convenient to place multiple questions on the same subject into a single page. If the resulting page is a serviceable unit, you can use and reuse this same page in different contexts, effectively reusing the same questions and question-controls to accomplish the same immediate tasks, but with a different higher-level goal.
SmartScript displays at once to the user all of the questions in a page section. A page section is a logical subset of all of the questions between page breaks. Page breaks are dynamically determined by SmartScript based on the following rules:
A branch leads from a question to a new page or the end of the script.
The last question on a page is completed.
One of SmartScript’s implicit page break rules causes a break.
About SmartScript’s Implicit Page Break Rules
Sometimes a question cannot appear on the same page with a preceding or following question, regardless of the other design criteria that you are considering, because of the mechanisms involved in a question’s definition. Siebel SmartScript processes each question, and if the processing of a question requires certain events, then it might have to end (or break) the current page to perform those events in a logical order.
For example, if a question has dynamic text substitution defined for it where the answer of the previous question determines the text for the question, then there must be a page break between these questions. Or, a question might have code executed when the question is completed to check some values in the answer before moving to the next question.
To determine where to break a page, Siebel SmartScript applies the following rules:
If a question has a VB leave event, such as Question_PreBranch, Question_PreLeave, or Question_Leave, Siebel SmartScript always breaks a page after that question.
If a question has a VB enter event such as Question_Enter or has a Search Spec, the page always breaks before that question.
If a question uses a User Parameter or a Buscomp Field to do Auto Substitution and a previous question in the same section sets that User Parameter or Buscomp Field (through Save Field), Siebel SmartScript breaks a page before that question.
If a question is on a Save Bus Comp and that business component is not positioned on any record, SmartScript breaks the page before that question, unless the first question in that page is also on the same business component. This rule allows new records to be created.
Siebel SmartScript’s implicit page break rules are based on the options used to define a question. As you work with these options, always consider their effects on the information flow and page design. It is often possible to put off a question that causes a mandatory page break until you want the page to end. Or, it is possible to move the location of VB or eScript code to a different location in the script to limit page breaks.
About HTML in the SmartScript User Interface
In SmartScript, all user interface (UI) elements are determined by HTML code and HTML templates. This means that an experienced HTML designer can redesign the appearance of a SmartScript or any element in it. Even a SmartScript Administrator with a basic understanding of HTML can change the displayed appearance of a Question by adding basic HTML formatting code.
You can work with HTML formatting on two levels:
To enhance the typography or graphic display associated with an individual question, you use HTML code within the question text—in a question’s Translation field.
To change the design and layout of the page, you work with the HTML template.
For more information, see the following topics:
Formatting Question Text Using HTML Tags
Using standard HTML tags in the question text, you can format any text that displays to the user within a SmartScript. When a SmartScript page is rendered within the SmartScript Player applet, HTML tags also render in a standard manner. This means that it is a simple task to make any text bold, italicized, or a different size or color.
The following example renders the text in bold:
<B>Be sure to enter a full description of your problem</B>
Adding Images
You can also add images to your SmartScript by putting image reference HTML tags into your question translations. You must provide an explicit path to an image file like a GIF or JPEG, and this image displays when that question translation text is rendered inside the SmartScript player applet.
Example:
<img src="\\goliath\images\explosion.gif">
Adding URLs
You can add URLs to questions to provide links to static, non-SWE-generated HTML pages, by adding a URL reference tag inside the question translation text. Always open these URLs in a separate browser. The URLs must not reference Siebel pages.
Example:
You can go to the<a href="http://www.oracle.com" target="_blank">Oracle Home Page</ a> for more information
Formatting Example
You can use standard HTML in the question translation text to customize your scripts. The following text was copied directly from the Question field in the Translations form under the Questions view:
<b> Step 1:</b>Click the Add button to add a new data source. <BR> <BR> <img src = “\\main\demofile\demo38\my_images\SmartScriptImages\SmartScript_buildX\DB2_Client_ Connector_CreateDataSrc.gif>
Your server administrator can provide you with the correct locations for images, applets, stylesheets, and so on, if you want to use such elements in a SmartScript.
Using HTML to Modify the Design Template
SmartScript pages are dynamically generated HTML content that combine the structure of the Web template with the UI elements and text from the SmartScript definition in the database. Most of the Web template is based on tables with SmartScript-specific SWE tags to substitute values from the SmartScript definition.
Typically, you change the template to make changes to the fundamental page design and layout. Much of the page design standard is based on tables, so making changes to table, row, and column parameters is relatively easy.
In the following image, questions are displayed from first to last in a single column. Each question starts directly after the preceding question and extends across the width of the single column. If you want to display a number of short fields side-by-side to make your page into a shorter form, you can modify the template to display data in two or more columns.
This template refers to a standard SmartScript page layout, the largest elements of which are represented in the image. The template establishes the formatting for several dynamically generated tables.

Using Siebel Tools to Modify the SmartScript View
You can make some changes to the SmartScript view using Siebel Tools. You can modify the view on which the SmartScript player applet appears to add or remove other applets. For example, you can remove the tree control in the employee SmartScript views simply by removing the tree applet from the view.
For more information on using Siebel Tools, see Configuring Siebel Business Applications and Siebel Developer's Reference.
Customizing the Revenue Schedule SmartScript
This topic describes what you can and cannot customize in the Revenue Schedule SmartScript. The Revenue Schedule SmartScript generates revenues associated with an opportunity. One execution of this SmartScript can create multiple revenue records, depending on the answers to certain questions.
You use the Administration - SmartScript screen to customize this SmartScript. The following list describes the changes that you can make to this SmartScript:
The order in which questions display.
How questions display.
This applies to properties of the question such as style, color, and the grouping of questions on a page.
The business object, business component, and field that a question answer is saved to.
Questions to ask.
Users can create only new questions that directly set revenue fields based on the answers. No special logic can be built on these new questions.
The following list describes the changes that you cannot make to the Revenue Schedule SmartScript:
Predefault values for questions.
Logic that handles the revenue creation process.
For example, you cannot modify questions, such as Number of new revenue periods and Replace existing revenues nor the logic that divides Total revenue into Periodic revenues.
If you want to extend or modify the functionality of the Revenue Schedule SmartScript, you can write Siebel VB or Siebel eScript code to implement the required functionality. This code is then invoked when you execute the Revenue Schedule SmartScript. For more information, see Extending Scripts with Siebel VB and Siebel eScript.