<?xml version="1.0" encoding="utf-8"?>
<ManualTopic ID="/baanerp/tl/onlinemanual/000030" xml:lang="en">
	<Header>
		<Title xmlns:HTML="http://www.w3.org/TR/REC-html40">Table sharing</Title>
		<Keyword ContextSensitive="No"><Level1>table sharing</Level1>
		</Keyword>
	</Header>
	<GeneralSection><SectionTitle>Purpose</SectionTitle>
		<Paragraph class="Default">In an ERP LN installation with multiple <Link href="/baanerp/tc/glossary/glossary#Company.tc" role="glossary">companies</Link>, it can be required to let two or more companies share some of the tables in order to get a certain functionality. For example, if several of your companies purchase items from the same suppliers, these companies can share the <Link href="/baanerp/tc/glossary/glossary#BusinePartne.tc" role="glossary">business-partner</Link> table.</Paragraph>
		<List><ListIntro>Table sharing has the following <Emphasis>advantages</Emphasis>:</ListIntro>
			<ListItem>The data that is entered is available in all other companies. The required work for data entry is reduced.</ListItem>
			<ListItem>Consistency of data is ensured between companies.</ListItem>
		</List>
		<List><ListIntro>Table sharing can have the following <Emphasis>disadvantages</Emphasis>:</ListIntro>
			<ListItem>Table sharing can cause errors if set up incorrectly.</ListItem>
			<ListItem>Table sharing can lead to very larges tables, which can reduce performance.</ListItem>
			<ListItem>If the table sharing is achieved by using data replication, you must perform regular replication actions.</ListItem>
		</List>
	</GeneralSection>
	<GeneralSection><SectionTitle>Methods</SectionTitle>
		<List><ListIntro>You can apply one of the following two methods of table sharing:</ListIntro>
			<ListItem><Link href="/baanerp/tt/glossary/glossary#000042" role="glossary">table sharing</Link>- data is effectively maintained in one location; changes are instantaneously visible in all companies.</ListItem>
			<ListItem><Link href="/baanerp/tt/glossary/glossary#000043" role="glossary">data replication</Link>- data is maintained separately in several companies; changes in one company are effective in other companies <Emphasis>after</Emphasis> replication.</ListItem>
		</List>
		<List><ListIntro>Two types of data replication exist.</ListIntro>
			<ListItem>Continuous replication by using a messaging system. You can use Infor ERP LN Business Adapter to achieve continuous replication. Continuous replication is not further discussed here.</ListItem>
			<ListItem><Link href="/baanerp/tt/glossary/glossary#100078" role="glossary">batch-oriented replication</Link>.</ListItem>
		</List>
		<Paragraph class="Default">You can also organize your work process to copy the data modifications in one company <Emphasis>manually</Emphasis> to the other companies. That is suitable for slowly-changing, static data, such as language codes and country codes.</Paragraph>
	</GeneralSection>
	<GeneralSection><SectionTitle>Table references</SectionTitle>
		<Paragraph class="Default">The table-sharing configuration must take the <Link href="/baanerp/tt/glossary/glossary#000046" role="glossary">table references</Link> into account. Otherwise, the referential integrity can be damaged.</Paragraph>
		<List><ListIntro>The consequences of a table reference depend on the table reference's <GUIRef href="/baanerp/tl/tsm/tltsm2100m001#tltsm010.refm" role="manual">Reference Mode</GUIRef>.</ListIntro>
			<ListItem><List><ListIntro>If table A has a field that refers to table B, and the <GUIRef href="/baanerp/tl/tsm/tltsm2100m001#tltsm010.refm" role="manual">Reference Mode</GUIRef> is <GUIRef href="/baanerp/tl/domains/tsm.refm#mandatory" role="option">Mandatory</GUIRef>, then the following rule applies:</ListIntro>
					<ListItem>If two companies share table A, they must also share table B.</ListItem>
				</List>
			</ListItem>
			<ListItem><List><ListIntro>If a table A has a field that refers to table B, and the reference mode is <GUIRef href="/baanerp/tl/domains/tsm.refm#mand.unl.empty" role="option">Mandatory unless empty</GUIRef>, then the following rule applies:</ListIntro>
					<ListItem>If two companies share table A, they must also share table B, unless the referring field is always left empty.</ListItem>
				</List>
			</ListItem>
			<ListItem>If the <GUIRef href="/baanerp/tl/tsm/tltsm2100m001#tltsm010.refm" role="manual">Reference Mode</GUIRef> is <GUIRef href="/baanerp/tl/domains/tsm.refm#non.mandatory" role="option">Not mandatory</GUIRef>, no additional restrictions apply.</ListItem>
		</List>
	</GeneralSection>
	<ExampleSection><SectionTitle>
                              Example
                           </SectionTitle>
		<Paragraph class="Default">The <GUIRef href="" role="manual">Items - General</GUIRef> table has a <GUIRef href="/baanerp/tc/ibd/tcibd0101s000#tcibd001.ctyo" role="manual">Country of Origin</GUIRef> field, that has a reference to the <GUIRef href="" role="manual">Countries</GUIRef> table with the <GUIRef href="/baanerp/tl/tsm/tltsm2100m001#tltsm010.refm" role="manual">Reference Mode</GUIRef> set to <GUIRef href="/baanerp/tl/domains/tsm.refm#mand.unl.empty" role="option">Mandatory unless empty</GUIRef>.</Paragraph>
		<Paragraph class="Default">Suppose the <GUIRef href="" role="manual">Items - General</GUIRef> table is shared between company 100 and 200, and the <GUIRef href="" role="manual">Countries</GUIRef> table is not shared. If you insert a new country code in company 100, and you insert that country code in the <GUIRef href="/baanerp/tc/ibd/tcibd0101s000#tcibd001.ctyo" role="manual">Country of Origin</GUIRef> field for an item, you will get a reference error if you look at the same item in company 200. If you view the item in company 200, the item's country of origin displays as "*****". If you use the item, a fatal error occurs. To prevent this, the <GUIRef href="" role="manual">Countries</GUIRef> table must also be shared or the <GUIRef href="/baanerp/tc/ibd/tcibd0101s000#tcibd001.ctyo" role="manual">Country of Origin</GUIRef> field must always be kept empty.</Paragraph>
	</ExampleSection>
	<RelatedTopics><SectionTitle>Related topics</SectionTitle>
		<RelTopic><Link href="/baanerp/tl/onlinemanual/000031" role="manual">To set up a table sharing configuration</Link>
		</RelTopic>
		<RelTopic><Link href="/baanerp/tl/onlinemanual/000032" role="manual">To analyze the present table linking configuration</Link>
		</RelTopic>
		<RelTopic><Link href="/baanerp/tl/onlinemanual/000033" role="manual">Soft references</Link>
		</RelTopic>
	</RelatedTopics>
</ManualTopic>
