Format Customization - Auto-Remapping

<< Click to Display Table of Contents >>

EQuIS 7  >>  EDP > Customizability >

Format Customization - Auto-Remapping

To use auto-remapping in an EQuIS custom format requires the following steps:

1.Add the attribute action to the format .xsd.

2.Add the method and return the format schema ID to the format .vb.

3.Add the lookup to RT_REMAP_DETAIL.

4.Remove lookups referencing fields being remapped.

5.Populate RT_REMAP and RT_REMAP_DETAIL in the EQuIS database.

 

Auto-remapping occurs on the Create step in EDP. If a remap value is not found in RT_REMAP_DETAIL, no remapping will occur and the original value will be used.

 

Example

 

Here is an example of adding an auto-remap to the ESBasic format that corresponds to the step above.

 

1.In .xsd file, add the attribute action="remap" to the mappings you want to auto-remap.

 

<edd:table mode="parent" target="dt_sample">

 

 

   <edd:field new_id="sample_id" target="sample_id"/>

 

   <edd:field source="Sys_Sample_Code" target="sys_sample_code" />

 

   <edd:field source="Sample_Matrix_Code" target="matrix_code" action="remap" />

 

</edd:table>

 

2.In the .vb file add method RemapCode and return the format schema ID.

 

Public Overrides Function RemapCode(ByVal sourceColumn As String, ByVal eddRow As System.Data.DataRow, ByVal targetColumn As String, ByVal targetRow As System.Data.DataRow) As String

 

 

     Return "ESBasic"

 

   End Function

 

3.Add the lookup to RT_REMAP_DETAIL in the .XSD file.

 

<edd:table mode="lookup" target="rt_remap_detail" />

 

4.Remove lookups referencing fields being remapped.

 

<edd:table mode="lookup" target="rt_matrix">

          <edd:lookup source="Sample_Matrix_Code" target="matrix_code" />

          <edd:field source="Sample_Matrix_Code" target="matrix_desc"/>

</edd:table>

 

5.Populate RT_REMAP and RT_REMAP_DETAIL in the EQuIS database. In RT_REMAP, add the following record:

 

REMAP_CODE = ESBasic

STATUS_FLAG = A

 

In RT_REMAP_DETAIL add the following record:

EXTERNAL_FIELD = SAMPLE_MATRIX_CODE

EXTERNAL_VALUE = GW

INTERNAL_VALUE = WG

STATUS_FLAG = A

REMAP_CODE = ESBasic

 

Note: To include multiple external values for remapping to the same internal value, separate the external values by the pipe (|) symbol in RT_REMAP_DETAIL.EXTERNAL_VALUE.

 

EXTERNAL_VALUE = GW|GRNDWTR

INTERNAL_VALUE = WG