<?xml version="1.0" encoding="utf-8"?>
<ManualTopic ID="/baanerp/tt/EnterpriseStudio/onlinemanual/to_create_dashboards" xml:lang="en" TopicType="Overview">
	<Header>
		<Title xmlns:HTML="http://www.w3.org/TR/REC-html40">To create dashboards</Title>
		<Keyword ContextSensitive="No"><Level1>
                                    Infor ERP LN Development Tools
                                 </Level1>
			<Level2>dashboard</Level2>
		</Keyword>
	</Header>
	<GeneralSection><List><ListIntro>To create a dashboard you must:</ListIntro>
			<ListItem>create the dashboard session and its form using the <GUIRef href="" role="session">Sessions (ttadv2500m000)</GUIRef> session. The dashboard session uses the main table of the entity that you want to select.</ListItem>
			<ListItem>Create a UI script for the dashboard session: The UI script controls most of the actions, including the selection, calculation and starting the details sessions.</ListItem>
			<ListItem>Create details sessions that allow the dashboard user to drill-down into the details of the overview presented in the dashboard.</ListItem>
		</List>
	</GeneralSection>
	<Important><SectionTitle>
                                 Important!
                              </SectionTitle>
		<Paragraph class="Default">The sections below describe the sessions that you must use to create a dashboard. However, they do not describe all details of these sessions. For detailed session information, refer to the Infor Web Help.</Paragraph>
	</Important>
	<GeneralSection><SectionTitle>To create the session</SectionTitle>
		<Paragraph class="Default">The dashboard session uses the main table of the entity that you want to select. The session is similar to an overview session. However, an overview session usually has a synchronized dialog to its details session. A dashboard session controls the synchronization to the various details sessions within the program script.</Paragraph>
		<ExampleSection><SectionTitle>
                                    Example- Items Dashboard</SectionTitle>
			<Paragraph class="Default">You need to create a dashboard session that uses the Items as the main entity. When you select an item, the dashboard will show the item, description, purchase price, stock on-hand and stock on-order for the item. Next to the purchase price, it will calculate the last purchase price. Next to the stock on-hand, it will display the inventory value (valued at purchase price). Next to the stock on-order, it will show the latest order date for orders that have not been delivered. A document button is available to view purchase orders for the item.</Paragraph>
			<Paragraph class="Default">You create an items dashboard session, using the Items table. The session is a display session type.</Paragraph>
			<Figure space-and-orientation="indented-estimated"><FigIntro>See the following figure for the session properties:</FigIntro>
				<HTML:IMG height="504" width="599" SRC="../images/nt_screen_to_create_dashboards1.gif" path="/enterpriseserver/tools/tt/enterprisestudio/onlinemanual" btb-count="1" btb-count2="1" btb-image-name="nt_screen_to_create_dashboards1.gif" btb-source-path="C:\SVN\docnl\Technology\EnterpriseServer~8.5\EnterpriseServer" btb-image-path="/enterpriseserver/tools/tt/enterprisestudio/images/nt_screen_to_create_dashboards1.gif" ID="IDAQQ0AC" alt="[...]" xmlns:HTML="http://www.w3.org/TR/REC-html40"/><FigCaption>Create Session</FigCaption>
			</Figure>
		</ExampleSection>
		<GeneralSection><SectionTitle>To create the form</SectionTitle>
			<Paragraph class="Default">The form of a dashboard session has two areas, the view field area and the grid.</Paragraph>
			<Figure space-and-orientation="indented-estimated"><HTML:IMG height="437" width="697" SRC="../images/tr_graph_to_create_dashboards2.gif" path="/enterpriseserver/tools/tt/enterprisestudio/onlinemanual" btb-count="1" btb-count2="1" btb-image-name="tr_graph_to_create_dashboards2.gif" btb-source-path="C:\SVN\docnl\Technology\EnterpriseServer~8.5\EnterpriseServer" btb-image-path="/enterpriseserver/tools/tt/enterprisestudio/images/tr_graph_to_create_dashboards2.gif" ID="IDAB50AC" alt="[...]" xmlns:HTML="http://www.w3.org/TR/REC-html40"/><FigCaption>Dashboard Session Areas</FigCaption>
			</Figure>
			<Paragraph class="Default">The view field area contains fields that are declared as variables, as opposed to table fields. While not required, these fields are typically defined in one or more groups.</Paragraph>
			<Paragraph class="Default">The view area contains check boxes and buttons. The check boxes are variables that are defined in the session's program script. The check boxes do not have labels. The buttons are field level form commands, that are linked to the check boxes. The form commands use labels to provide the names for the buttons.</Paragraph>
			<Paragraph class="Default">Since the view field area contains group boxes and field buttons, <GUIRef href="" role="manual">Rich View</GUIRef> should be selected in the Session Properties for the form.</Paragraph>
			<Paragraph class="Default">The grid is typically defined in another group. The grid contains table fields and the number of fields in the grid may be limited to a few key fields. A new group is not required, but helps you in separating the two areas.</Paragraph>
			<ExampleSection><SectionTitle>
                                       Example- Items Dashboard</SectionTitle>
				<Paragraph class="Default">You create an items dashboard session using the Items table. The session is a display session type.</Paragraph>
				<Figure space-and-orientation="indented-estimated"><HTML:IMG height="548" width="463" SRC="../images/nt_screen_to_create_dashboards3.gif" path="/enterpriseserver/tools/tt/enterprisestudio/onlinemanual" btb-count="1" btb-count2="1" btb-image-name="nt_screen_to_create_dashboards3.gif" btb-source-path="C:\SVN\docnl\Technology\EnterpriseServer~8.5\EnterpriseServer" btb-image-path="/enterpriseserver/tools/tt/enterprisestudio/images/nt_screen_to_create_dashboards3.gif" ID="IDACR0AC" alt="[...]" xmlns:HTML="http://www.w3.org/TR/REC-html40"/><FigCaption>Dashboard Form Editor</FigCaption>
				</Figure>
				<Paragraph class="Default">In the Dynamic Form Editor you must specify the session properties, the field properties and form commands.</Paragraph>
				<Paragraph class="Default">Specify the following properties in the <GUIRef href="" role="manual">Session Properties</GUIRef> dialog box:</Paragraph>
				<TABLE border="1" borderstyle="default" space-and-orientation="indented-estimated"><THEAD><TR><TD rowspan="1" colspan="1">Field</TD>
							<TD rowspan="1" colspan="1">Value</TD>
						</TR>
					</THEAD>
					<TBODY><TR><TD rowspan="1" colspan="1">Overview Session</TD>
							<TD rowspan="1" colspan="1">Yes</TD>
						</TR>
						<TR><TD rowspan="1" colspan="1">Rich View</TD>
							<TD rowspan="1" colspan="1">Yes</TD>
						</TR>
						<TR><TD rowspan="1" colspan="1">Remaining fields</TD>
							<TD rowspan="1" colspan="1">No</TD>
						</TR>
					</TBODY>
				</TABLE>
				<Paragraph class="Default">Fields in the view area are variables that are defined in the session's program script, such as "sel.item". See the sample script in this section for more examples. Specify the following properties in the <GUIRef href="" role="manual">Position</GUIRef> tab in the <GUIRef href="" role="manual">Field Properties</GUIRef> dialog box:</Paragraph>
				<TABLE border="1" borderstyle="default" space-and-orientation="indented-estimated"><THEAD><TR><TD rowspan="1" colspan="1">Field</TD>
							<TD rowspan="1" colspan="1">Value</TD>
						</TR>
					</THEAD>
					<TBODY><TR><TD rowspan="1" colspan="1">Overview Session</TD>
							<TD rowspan="1" colspan="1">Yes</TD>
						</TR>
						<TR><TD rowspan="1" colspan="1">View Field</TD>
							<TD rowspan="1" colspan="1">Yes</TD>
						</TR>
						<TR><TD rowspan="1" colspan="1">Remaining fields</TD>
							<TD rowspan="1" colspan="1">No / empty</TD>
						</TR>
					</TBODY>
				</TABLE>
				<Paragraph class="Default">The field properties for the <GUIRef href="" role="manual">Documents</GUIRef> check box fields do not have a label code. The button next to each document check box is defined as a field level form command, that is linked to the corresponding check box field. It executes a function that will be defined in the program script.</Paragraph>
				<Figure space-and-orientation="indented-estimated"><HTML:IMG height="556" width="558" SRC="../images/nt_screen_to_create_dashboards4.gif" path="/enterpriseserver/tools/tt/enterprisestudio/onlinemanual" btb-count="1" btb-count2="1" btb-image-name="nt_screen_to_create_dashboards4.gif" btb-source-path="C:\SVN\docnl\Technology\EnterpriseServer~8.5\EnterpriseServer" btb-image-path="/enterpriseserver/tools/tt/enterprisestudio/images/nt_screen_to_create_dashboards4.gif" ID="IDALR0AC" alt="[...]" xmlns:HTML="http://www.w3.org/TR/REC-html40"/><FigCaption>Field Level Form Command linked to "sel.orders" Check Box</FigCaption>
				</Figure>
				<Paragraph class="Default">You can use the <GUIRef href="" role="manual">Show Overview Session</GUIRef> command in the Dynamic Form Editor to start the session.</Paragraph>
				<Figure space-and-orientation="indented-estimated"><HTML:IMG height="316" width="659" SRC="../images/nt_screen_to_create_dashboards5.gif" path="/enterpriseserver/tools/tt/enterprisestudio/onlinemanual" btb-count="1" btb-count2="1" btb-image-name="nt_screen_to_create_dashboards5.gif" btb-source-path="C:\SVN\docnl\Technology\EnterpriseServer~8.5\EnterpriseServer" btb-image-path="/enterpriseserver/tools/tt/enterprisestudio/images/nt_screen_to_create_dashboards5.gif" ID="IDAUR0AC" alt="[...]" xmlns:HTML="http://www.w3.org/TR/REC-html40"/><FigCaption>Show Overview Session Result</FigCaption>
				</Figure>
			</ExampleSection>
		</GeneralSection>
	</GeneralSection>
	<GeneralSection><SectionTitle>To create the program script</SectionTitle>
		<Paragraph class="Default">The program script controls most of the actions, including the selection, calculation and starting the details sessions.</Paragraph>
		<Paragraph class="Default">The actions that occur when the user selects a row are programmed in a mark.occur event. This event will gather the information for the selected value, and enable the form commands. It will also re-synchronize the details sessions.</Paragraph>
		<Paragraph class="Default">The detail sessions are started via a form command. Since the script will control the synchronization, it is preferred that the form commands call a function in the script. This function is defined as an extern function.</Paragraph>
		<ExampleSection><SectionTitle>
                                    Example- Items Dashboard</SectionTitle>
			<List><ListIntro>The Items dashboard needs to:</ListIntro>
				<ListItem>Declare the form variables.</ListItem>
				<ListItem>Declare the tables used in the calculation of the form variables (unless a library calculates these values)</ListItem>
				<ListItem>Contain actions for the mark.occur event</ListItem>
				<ListItem>Contain actions for the functions called by the field level form commands</ListItem>
				<ListItem>Start a synchronized child process in the functions called by the field level form command. Uses the start.synchronized.child function.</ListItem>
			</List>
			<Paragraph class="Default">See the following code for an example:</Paragraph>
			<CodeBlock space-and-orientation="indented-estimated">|*********************************************************
|* cxoes0520  0  VRC B61U a  dv00
|* Items Dashboard
|* Development User              
|* 2005-02-10
|*********************************************************
|* Main table cxoes020 Items, Form Type 1
|*********************************************************
                                                                                
|****************************** declaration section ******
declaration:

  table   tcxoes020 | Items
  table   tcxoes022 | PO Headers
  table   tcxoes023 | PO Lines
  
  extern domain	cxitem	sel.item
  extern domain	cxdscr	sel.dscr
  extern domain cxprice sel.ppri, sel.lopp, sel.sval
  extern domain cxquan  sel.stoh, sel.stoo
  extern domain cxdate  sel.lodt
  extern domain cxyeno  sel.orders
  
  	long	orders.session.child.id, dummy.ret

|****************************** program section **********
|****************************** group section ************
|****************************** choice section ***********
choice.mark.occur:
after.choice:
	if number.of.marks = 1 then
		|use a pre-defined var to test that only 
		|one item is selected from the list
		fill.sel.values()
		sync.open.session()
	else
		clear.sel.values()
	endif
	| need to display values because they are not 
	| displayed automatically
	display.all()
	
|****************************** function section *********

functions:
function fill.sel.values()
{
	sel.item = cxoes020.item
	sel.dscr = cxoes020.dscr
	sel.stoh = cxoes020.stoh
	sel.stoo = cxoes020.stoo
	sel.ppri = cxoes020.ppri
	sel.sval = sel.stoh * sel.ppri
	get.last.order.info.for.item()
}

function clear.sel.values()
{
	sel.item = " "
	sel.dscr = " "
	sel.ppri = 0.0
	sel.lopp = 0.0
	sel.sval = 0.0
	sel.stoh = 0
	sel.stoo = 0
	sel.lodt = 0
	sel.orders = cxyeno.no
}

function get.last.order.info.for.item()
{
	|* last purchase price is latest order, no matter of status
	select cxoes022.*, cxoes023.*
	from   cxoes022, cxoes023
	where  cxoes023.orno refers to cxoes022
	and    cxoes023.item = :sel.item
	order by cxoes022.odat desc
	as set with 1 rows
	selectdo
		sel.lopp = cxoes023.ppri
		sel.orders = cxyeno.yes
	selectempty
		sel.lopp = 0
		sel.orders = cxyeno.no
	endselect

	|* last purchase order date is latest open order
	|* stat &lt;&gt; delivered

	select cxoes022.*, cxoes023.*
	from   cxoes022, cxoes023
	where  cxoes023.orno refers to cxoes022
	and    cxoes023.item = :sel.item
	and    cxoes022.stat &lt;&gt; cxstat.delivered
	order by cxoes022.odat desc
	as set with 1 rows
	selectdo
		sel.lodt = cxoes022.odat
	selectempty
		sel.lodt = 0
	endselect
}

function extern exec.orders()
{
	if sel.orders = cxyeno.yes then
	  | document is checked, start the child process	
	  if orders.session.child.id then
		| already started the session, so re-use it
		| but refresh with new item values
		| if closed, will set child.id to 0
		dummy.ret = synchronize.with.child(orders.session.child.id)
	  endif
	  if not orders.session.child.id then
		| need to start the session
		session.zoomindex = 1
		| if there is a alt key by item, we could use it
		orders.session.child.id = start.synchronized.child(
					"cxoes0523m100",
					"cxoes020.item",
					"cxoes020.item")
		|* start orders by item. Send parent var of cxoes023.item, 
		|* and child var of cxoes020 for query extension to 
		|* work in child session.
	  endif
	endif	
}

function sync.open.session()
{
	| have the dashboard sync the open sessions when a new
	| item value is selected
	if orders.session.child.id then
		| already started the session, so re-use it
		| but refresh with new item values
		dummy.ret = synchronize.with.child(orders.session.child.id)
	endif	
}

</CodeBlock>
			<Paragraph class="Default">When you compile this script, the session can compute values.</Paragraph>
			<Figure space-and-orientation="indented-estimated"><HTML:IMG height="399" width="660" SRC="../images/nt_screen_to_create_dashboards6.gif" path="/enterpriseserver/tools/tt/enterprisestudio/onlinemanual" btb-count="1" btb-count2="1" btb-image-name="nt_screen_to_create_dashboards6.gif" btb-source-path="C:\SVN\docnl\Technology\EnterpriseServer~8.5\EnterpriseServer" btb-image-path="/enterpriseserver/tools/tt/enterprisestudio/images/nt_screen_to_create_dashboards6.gif" ID="IDA3R0AC" alt="[...]" xmlns:HTML="http://www.w3.org/TR/REC-html40"/><FigCaption>Item Dashboard with Computed Values</FigCaption>
			</Figure>
			<Paragraph class="Default">Select another item to show the values for that item.</Paragraph>
			<Figure space-and-orientation="indented-estimated"><HTML:IMG height="388" width="659" SRC="../images/nt_screen_to_create_dashboards7.gif" path="/enterpriseserver/tools/tt/enterprisestudio/onlinemanual" btb-count="1" btb-count2="1" btb-image-name="nt_screen_to_create_dashboards7.gif" btb-source-path="C:\SVN\docnl\Technology\EnterpriseServer~8.5\EnterpriseServer" btb-image-path="/enterpriseserver/tools/tt/enterprisestudio/images/nt_screen_to_create_dashboards7.gif" ID="IDAGS0AC" alt="[...]" xmlns:HTML="http://www.w3.org/TR/REC-html40"/><FigCaption>Item Dashboard</FigCaption>
			</Figure>
		</ExampleSection>
	</GeneralSection>
	<GeneralSection><SectionTitle>To create the details sessions</SectionTitle>
		<Paragraph class="Default">The details sessions allow the dashboard user to drill-down into the details of the overview presented in the dashboard. A details session will typically import the values from the dashboard session, and start or limit the display to those records. The program scripts of the details sessions can be modified to import these values and in some cases, extend the query so that only the desired rows are displayed.</Paragraph>
		<ExampleSection><SectionTitle>
                                    Example- Items Dashboard</SectionTitle>
			<Paragraph class="Default">You have created an Items dashboard session using the Items table. The order lines for the Item must be shown in a details session. The <GUIRef href="" role="session">Purchase Order Lines (cxoes0523m100)</GUIRef> session uses the Purchase Order Lines (cxoes023) table to show purchase order lines. You edit the form of this session to insure that the <GUIRef href="" role="manual">Item</GUIRef> field is a view field.</Paragraph>
			<Figure space-and-orientation="indented-estimated"><HTML:IMG height="354" width="455" SRC="../images/nt_screen_to_create_dashboards8.gif" path="/enterpriseserver/tools/tt/enterprisestudio/onlinemanual" btb-count="1" btb-count2="1" btb-image-name="nt_screen_to_create_dashboards8.gif" btb-source-path="C:\SVN\docnl\Technology\EnterpriseServer~8.5\EnterpriseServer" btb-image-path="/enterpriseserver/tools/tt/enterprisestudio/images/nt_screen_to_create_dashboards8.gif" ID="IDAPS0AC" alt="[...]" xmlns:HTML="http://www.w3.org/TR/REC-html40"/><FigCaption>Purchases by Item Form</FigCaption>
			</Figure>
			<Paragraph class="Default">The program script extends the query in the before.program section. The query extension is required because there is not an index on the field that contains the filter.</Paragraph>
			<CodeBlock space-and-orientation="indented-estimated">|*************************************************************
|* cxoes0523  0  VRC B61U a  dv00
|* Purchases by Item
|* Development User              
|* 2005-01-07
|*************************************************************
|* Main table cxoes023 Purchase Order Lines, Form Type 1
|*************************************************************
                                                                                
|****************************** declaration section **********
declaration:

  table   tcxoes020 | Items
  table   tcxoes023 | Purchase Order Lines

|****************************** program section **************
|* import item from calling session
|* query extension to create filter

before.program:
	query.extend.where(" cxoes023.item = :cxoes020.item")

|****************************** group section ****************

 
</CodeBlock>
			<Paragraph class="Default">When this session is started from the dashboard, the session will show only the orders for the item that is selected in the dashboard.</Paragraph>
			<Figure space-and-orientation="indented-estimated"><HTML:IMG height="321" width="696" SRC="../images/nt_screen_to_create_dashboards9.gif" path="/enterpriseserver/tools/tt/enterprisestudio/onlinemanual" btb-count="1" btb-count2="1" btb-image-name="nt_screen_to_create_dashboards9.gif" btb-source-path="C:\SVN\docnl\Technology\EnterpriseServer~8.5\EnterpriseServer" btb-image-path="/enterpriseserver/tools/tt/enterprisestudio/images/nt_screen_to_create_dashboards9.gif" ID="IDAYS0AC" alt="[...]" xmlns:HTML="http://www.w3.org/TR/REC-html40"/><FigCaption>Dashboard with Detail Session</FigCaption>
			</Figure>
			<Paragraph class="Default">When you select another item, and click the <GUIRef href="" role="command">Documents</GUIRef> button, the details session will synchronize. The item from the dashboard session will be sent to the details session, and the purchase orders for that item will display.</Paragraph>
			<Figure space-and-orientation="indented-estimated"><HTML:IMG height="306" width="658" SRC="../images/nt_screen_to_create_dashboards10.gif" path="/enterpriseserver/tools/tt/enterprisestudio/onlinemanual" btb-count="1" btb-count2="1" btb-image-name="nt_screen_to_create_dashboards10.gif" btb-source-path="C:\SVN\docnl\Technology\EnterpriseServer~8.5\EnterpriseServer" btb-image-path="/enterpriseserver/tools/tt/enterprisestudio/images/nt_screen_to_create_dashboards10.gif" ID="IDAZQ0AC" alt="[...]" xmlns:HTML="http://www.w3.org/TR/REC-html40"/><FigCaption>Select Item on Dashboard with Detail Session</FigCaption>
			</Figure>
		</ExampleSection>
	</GeneralSection>
	<RelatedTopics><SectionTitle>
                                 Related topics
                              </SectionTitle>
		<RelTopic><Link href="/baanerp/tt/EnterpriseStudio/onlinemanual/dashboards" role="manual">Dashboards</Link>
		</RelTopic>
		<RelTopic><Link href="/baanerp/tt/EnterpriseStudio/onlinemanual/to_edit_forms" role="manual">To edit forms</Link>
		</RelTopic>
		<RelTopic><Link href="/baanerp/tt/EnterpriseStudio/onlinemanual/to_create_sessions" role="manual">To create sessions</Link>
		</RelTopic>
	</RelatedTopics>
</ManualTopic>
