Previous Topic: Example of Sharing

Next Topic: Adding Virtual Fields to File-to-file Relations

Use of For Text for a Parts Assembly

This example is intended to show the use of For text to distinguish between different entries of the same field on a single file. This example includes the use of Sharing.

A Company is defined as follows:

FIL Company REF Known by FLD Customer code CDE

FIL Company REF Has FLD Customer name TXT

FIL Division REF Owned by FIL Company REF

FIL Division REF Known by FLD Division code CDE

FIL Division REF Has FLD Division name TXT

And each Company is split into divisions, thus a Division is defined as follows:

FIL Division REF Owned by FIL Company REF

FIL Division REF Known by FLD Division code CDE

FIL Division REF Has FLD Division name TXT

Let us now introduce the products handled by the company and say that each Division produces different products or parts. This means that a Part is to be defined as follows:

FIL Part REF Owned by FIL Division REF

FIL Part REF Known by FLD Part code CDE

FIL Part REF Has FLD Part name TXT

The above relations result in the following entries. Note that Part has both Company code and Division code in its key:

 

Company file

 

 

 

Division file

K

Company code

Company name

 

 

K

K

Company code

Division code

Division name

 

 

 

 

 

 

 

 

 

Part file

 

 

 

 

K

K

K

Company code

Division code

Part code

Part name

 

 

The basic description of an Assembly includes two separate references to a Part, one as Resulting Part and one as Component Part. You can distinguish between the two by use of the For text:

FIL Assembly REF Owned by FIL Part REF

For: Resulting Sharing: *ALL

FIL Assembly REF Owned by FIL Part REF

For: Component Sharing: *ALL

FIL Assembly REF Has FLD Assembly qty QTY

After the first instance of the Part code field on the Part file, the For text will be prefixed to each additional instance to create a unique entry name.

As a further consideration, you need to decide whether the Resulting parts and the Component parts belong to the same Division and Company. Whether they do or not is indicated by the value specified for the Sharing field. As a default, sharing is assumed. In this instance, it will be assumed that the Company and Division for both Component and Resulting parts is the same. The Component part must be from the same Company and Division as the resulting part. This means any fields that would be duplicated by the resolution of both Owned by relations will not actually be repeated.

The following entries would result:

 

Assembly file

K

K

K

K

Company code

Division code

Part code

Component Part code

Assembly qty

Thus, the additional instances of Company code and Division code that may arise from the second Owned by relation have been suppressed.

If the Component belongs to different divisions and companies than the "Resulting" part, we would specify that there is no sharing of common keys; that is, specify a value of *NONE for the Sharing field. This causes any fields, whose presence would be duplicated on the generated file by the resolution of both of the Owned by relations, to be repeated with different names.

FIL Assembly REF Owned by FIL Part REF

For: Resulting Sharing: *NONE

FIL Assembly REF Owned by FIL Part REF

For: Component Sharing: *NONE

FIL Assembly REF Has FLD Assembly qty QTY

This would result in the separate entries for the Resulting Company code, the Resulting Division code, and Resulting Part code, as follows:

 

Assembly file

K

K

K

K

K

K

Company code

Division code

Part code

Component Company code

Component Division code

Component Part code

Assembly quantity

A third variation may be the case where components can be from divisions different than those of the resulting assembly but the resulting assembly and component must be for the same company. In this case you would specify that there is sharing only of Company. This causes the duplicate reference to the Company code to be dropped.

FIL Assembly REF Owned by FIL Part REF

For: Resulting Sharing: Company

FIL Assembly REF Owned by FIL Part REF

For: Component Sharing: Company

FIL Assembly REF Has FIL Assembly qty QTY

This would result in the following entries:

 

Assembly file

K

K

K

K

K

 

Company code

Division code

Part code

Component Division code

Component Part code

Assembly qty