<?xml version="1.0" encoding="utf-8"?>
<ManualTopic ID="/baanerp/tt/EnterpriseStudio/onlinemanual/to_create_a_data_model" xml:lang="en" TopicType="Overview">
	<Header>
		<Title xmlns:HTML="http://www.w3.org/TR/REC-html40">To create a data model</Title>
		<Keyword ContextSensitive="No"><Level1>
                                    Infor ERP LN Development Tools
                                 </Level1>
			<Level2>data model</Level2>
		</Keyword>
		<Keyword ContextSensitive="No"><Level1>
                                    Infor ERP LN Development Tools
                                 </Level1>
			<Level2>domain</Level2>
		</Keyword>
		<Keyword ContextSensitive="No"><Level1>
                                    Infor ERP LN Development Tools
                                 </Level1>
			<Level2>table definition</Level2>
		</Keyword>
		<Keyword ContextSensitive="No"><Level1>
                                    Infor ERP LN Development Tools
                                 </Level1>
			<Level2>table</Level2>
		</Keyword>
	</Header>
	<AimSection><Paragraph class="Default">This topic describes the procedure to create a data model.</Paragraph>
	</AimSection>
	<Important><SectionTitle>
                                 Important!
                              </SectionTitle>
		<Paragraph class="Default">The sections below describe the sessions that you must use to complete the procedure. However, they do not describe all details of these sessions. For detailed session information, refer to the Infor Web Help.</Paragraph>
	</Important>
	<GeneralSection><SectionTitle>Procedure aim</SectionTitle>
		<Paragraph class="Default">
                                 ERP LN uses a database system to store the data required by the application. Data is stored in tables in a relational database management system (RDBMS). The data dictionary describes the data model of the data required in the application.</Paragraph>
		<List><ListIntro>You use Development Tools to define the data dictionary and create:</ListIntro>
			<ListItem>Domains</ListItem>
			<ListItem>Table Definitions, including fields, labels, foreign key relationships and indices</ListItem>
			<ListItem>Tables to store data, for one or more companies, based on the table definitions</ListItem>
		</List>
		<Paragraph class="Default">You can use the <GUIRef href="" role="manual">Entity Relationship Diagrams (tgerm1500m000)</GUIRef> session in the Enterprise Modeler to create a graphic design of the relational data model structure. The diagram shows a (multilevel) structure that consists of entity types and entity type relationships. For details, refer to the Infor Web Help.</Paragraph>
		<Note><SectionTitle>
                                    Note
                                 </SectionTitle>
			<Paragraph class="Default">The ERP LN data dictionary is an active data dictionary. This means that sessions that use a table will discover the fields, domains, relationships, indices and other information about a table when the table is used at runtime, not at compile time. This feature allows you to change data dictionary items without recompiling code.</Paragraph>
		</Note>
	</GeneralSection>
	<GeneralSection><SectionTitle>Procedure result and prerequisites</SectionTitle>
		<Tip><SectionTitle>Result</SectionTitle>
			<Paragraph class="Default">A data model for an ERP LN application.</Paragraph>
		</Tip>
		<Tip><SectionTitle>Prerequisites</SectionTitle>
			<List><ListIntro>To create a data model you need:</ListIntro>
				<ListItem>A development package VRC in which you can create the domains and table definitions.</ListItem>
				<ListItem>Developer authorization for this VRC.</ListItem>
			</List>
		</Tip>
	</GeneralSection>
	<GeneralSection><SectionTitle>Procedure summary</SectionTitle>
		<ProcedureList><ListIntro>The following list shows the procedure steps and the corresponding sessions:</ListIntro>
			<ListItem>Create domains - <GUIRef href="" role="manual">Domains (ttadv4500m000)</GUIRef>
			</ListItem>
			<ListItem>Create table definitions, including fields, labels, foreign key relationships and indices - <GUIRef href="" role="manual">Table Definitions (ttadv4520m000)</GUIRef>
			</ListItem>
			<ListItem>Convert the domains and table definitions to the runtime data dictionary - <GUIRef href="" role="manual">Convert to Runtime Data Dictionary (ttadv5215m000)</GUIRef>
			</ListItem>
			<ListItem>Create tables to store data - <GUIRef href="" role="manual">Create Tables (ttaad4230m000)</GUIRef>
			</ListItem>
		</ProcedureList>
	</GeneralSection>
	<ProcedureSection><SectionTitle>Procedure details</SectionTitle>
		<Steps><Step><StepTitle>Create domains</StepTitle>
				<ProcedureList><ListIntro>To create a domain:</ListIntro>
					<ListItem>Start the <GUIRef href="" role="manual">Domains (ttadv4500m000)</GUIRef> session.</ListItem>
					<ListItem>Add a row. Enter the data type, length, format and field validation rules for the domain in the <GUIRef href="" role="manual">Domains (ttadv4100m000)</GUIRef> details session.</ListItem>
					<ListItem>Perform this step only if the data type is Enumerated or Set: <List><ListItem>In the <GUIRef href="" role="manual">Domains (ttadv4500m000)</GUIRef> overview session, select the domain and on the <GUIRef href="" role="menu">Specific</GUIRef> menu, click <GUIRef href="" role="manual">Enum/Set Data</GUIRef>. The <GUIRef href="" role="manual">Enum/Set Constants (ttadv4501m000)</GUIRef> session starts. Enter the values for the constants, names and descriptions.</ListItem>
							<ListItem>Note: The constant description should be no longer than the defined length of the domain. If a description is longer than the domain length, you can increase the domain length.</ListItem>
						</List>
					</ListItem>
					<ListItem>Save the new data and close the sessions.</ListItem>
				</ProcedureList>
			</Step>
			<Step><StepTitle>Create table definitions</StepTitle>
				<ProcedureList><ListIntro>To create a table definition:</ListIntro>
					<ListItem>Start the <GUIRef href="" role="manual">Table Definitions (ttadv4520m000) session</GUIRef>.</ListItem>
					<ListItem>Click <GUIRef href="" role="manual">New</GUIRef> to start the <GUIRef href="" role="manual">Table Definitions (ttadv4120s000)</GUIRef> details session. Enter the basic table information, such as the table code and description. Save the changes and return to the overview session..</ListItem>
					<ListItem>Define the table fields: <List><ListItem>Open the new table. The <GUIRef href="" role="manual">Table Definitions (ttadv4520m100)</GUIRef> session will open. This session is a multi-main table session showing the Table Fields, Indices and Program Scripts / Libraries for the table.</ListItem>
							<ListItem>In the <GUIRef href="" role="manual">Table Fields</GUIRef> tab, click <GUIRef href="" role="manual">New Table Field</GUIRef>. The <GUIRef href="" role="manual">Table Fields (ttadv4122s000)</GUIRef> details session starts. Enter the table field information. Specify, among other things, a field code, a domain, a label, and (optionally) a reference to another table. For details, refer to the session's online help.</ListItem>
							<ListItem>When finished, save the changes and return to the <GUIRef href="" role="manual">Table Definitions (ttadv4520m100)</GUIRef> multi-main table session.</ListItem>
						</List>
					</ListItem>
					<ListItem>Define one or more indices: <List><ListItem>In the <GUIRef href="" role="manual">Indices</GUIRef> tab, click <GUIRef href="" role="manual">New Index</GUIRef>. The <GUIRef href="" role="manual">Table Indices (ttadv4121s000)</GUIRef> session starts.</ListItem>
							<ListItem>Add a row. Enter the index information, such as the index number, description and the index parts (table fields).</ListItem>
						</List>
					</ListItem>
					<ListItem>Save the new data and close the sessions.</ListItem>
				</ProcedureList>
				<Paragraph class="Default">Points of attention:</Paragraph>
				<TABLE border="1" borderstyle="default" space-and-orientation="indented-estimated"><TBODY><TR><TD rowspan="1" colspan="1">Labels</TD>
							<TD rowspan="1" colspan="1">
								<Paragraph class="Default">As you enter table fields, labels will be created for the table field descriptions. You can create a new labels, or use existing labels. Using existing labels provides an easy method to adapt your companies terminology and aid translation activities.</Paragraph> <Paragraph class="Default">After labels are created, you must compile the labels so that users can use the labels as they execute the system. You should compile labels after you create enumerate domains, tables, sessions and forms, reports, and other components. To compile labels, use the <GUIRef href="" role="manual">Compile Labels (ttadv1243m000)</GUIRef> session.</Paragraph>
							</TD>
						</TR>
						<TR><TD rowspan="1" colspan="1">Reference tables</TD>
							<TD rowspan="1" colspan="1">When you specify the fields for a table, you can define references to other tables. For this reason, it is helpful to create tables, that will be referred to by other tables, first.</TD>
						</TR>
						<TR><TD rowspan="1" colspan="1">Combined fields</TD>
							<TD rowspan="1" colspan="1">
								<Paragraph class="Default">Table fields can refer to a primary key of another table. In this way, the references are built into the data dictionary.</Paragraph> <Paragraph class="Default">To define a reference to a table whose primary key contains more than one field, you must use combined fields. Combined fields require that you define the combined field in the reference table and in the referring table. Combined fields are only used in defining tables; actual fields are not created within the database.</Paragraph> <ProcedureList><ListIntro>To create a combined field:</ListIntro>
									<ListItem>Create a new table field and, in the field properties, select the <GUIRef href="" role="manual">Combined Field</GUIRef> attribute.</ListItem>
									<ListItem>Click <GUIRef href="" role="manual">Child Fields</GUIRef> to start the <GUIRef href="" role="manual">Child Fields by Combined Field (ttadv4523m000)</GUIRef> session.</ListItem>
									<ListItem>Enter the table fields that make up the combined field.</ListItem>
									<ListItem>Use the combined field as the first index of the reference table.</ListItem>
								</ProcedureList> <Paragraph class="Default">In the field properties of the combined field in the referring table, you can now define a reference to the reference table.</Paragraph> <Paragraph class="Default">Example:</Paragraph> <Paragraph class="Default">A purchase order line for an item can have more than one arrival at the warehouse. For this reason, the table design requires that an arrival table is a child of the purchase order line table. The primary key of the purchase order line table can be viewed as order number and position number. The arrivals table must have a field that can refer to order number and position number. Therefore, a combined field is used. The combined field “cmba” is created in both tables, with the order number and position number as the child fields. In the field properties of the "cmba" field in the arrivals table, a reference to the purchase order line table is defined.</Paragraph>
							</TD>
						</TR>
					</TBODY>
				</TABLE>
			</Step>
			<Step><StepTitle>Convert the domains and table definitions to the runtime data dictionary</StepTitle>
				<Paragraph class="Default">The table definitions are maintained in the application data dictionary. You must make the new domains and table definitions available to the runtime environment. This process is called Convert to Runtime.</Paragraph>
				<Paragraph class="Default">A convert to runtime is performed for tables, domains and sessions based on the package combination. The process will search the Package VRCs of the packages in the package combination and create the table and domain runtime files in the runtime data dictionary directory on the application server. This directory is established when you create the package combination.</Paragraph>
				<ProcedureList><ListIntro>To convert to runtime:</ListIntro>
					<ListItem>Start the <GUIRef href="" role="manual">Convert to Runtime Data Dictionary (ttadv5215m000)</GUIRef> session.</ListItem>
					<ListItem>Select the <GUIRef href="" role="manual">Domains</GUIRef> and <GUIRef href="" role="manual">Tables</GUIRef> check boxes. Specify the appropriate ranges of package combinations, packages and tables.</ListItem>
					<ListItem>Click <GUIRef href="" role="manual">Convert</GUIRef>.</ListItem>
				</ProcedureList>
			</Step>
			<Step><StepTitle>Create tables to store data</StepTitle>
				<Paragraph class="Default">Tables store data. In order to store data, the table definition is used to create a table in the underlying database for a specific company number. In most companies, a person designated as the system administrator or database administrator will create tables.</Paragraph>
				<List><ListIntro>Before you create tables, the following pre-requisites must be in place:</ListIntro>
					<ListItem>The data dictionary must be converted to runtime for the package combination.</ListItem>
					<ListItem>Your ERP LN user id must use the package combination of the company.</ListItem>
					<ListItem>A company must be created with your package combination.</ListItem>
					<ListItem>The database administration and storage requirements must be setup to create tables in the appropriate database and storage area.</ListItem>
				</List>
				<ProcedureList><ListIntro>To create tables:</ListIntro>
					<ListItem>Start the <GUIRef href="" role="manual">Create Tables (ttaad4230m000)</GUIRef> session. Optionally, you can start this session from the <GUIRef href="" role="menu">Specific</GUIRef> menu in the <GUIRef href="" role="manual">Table Definitions</GUIRef> session.</ListItem>
					<ListItem>Specify the appropriate ranges of companies, packages and tables.</ListItem>
					<ListItem>Click <GUIRef href="" role="manual">Create</GUIRef>.</ListItem>
				</ProcedureList>
			</Step>
		</Steps>
	</ProcedureSection>
	<RelatedTopics><SectionTitle>
                                 Related topics
                              </SectionTitle>
		<RelTopic><Link href="/baanerp/tt/EnterpriseStudio/onlinemanual/domains" role="manual">Domains</Link>
		</RelTopic>
		<RelTopic><Link href="/baanerp/tt/EnterpriseStudio/onlinemanual/table_definitions" role="manual">Table definitions</Link>
		</RelTopic>
		<RelTopic><Link href="/baanerp/tt/EnterpriseStudio/onlinemanual/data_dictionaries" role="manual">Data dictionaries</Link>
		</RelTopic>
		<RelTopic><Link href="/baanerp/tt/EnterpriseStudio/onlinemanual/to_reconfigure_tables" role="manual">To reconfigure tables</Link>
		</RelTopic>
	</RelatedTopics>
</ManualTopic>
