Reference manual

Objects page

Transfer fields window

Target.TransferFields(Source) copies fields by field number. The Transfer fields window shows how the fields of two tables pair up, flags types that do not match, and shows the fields that cannot take part.

Opening it

Show TransferFields Mapping From… is offered for tables only, and needs a license.

Prism for AL Transfer fields window with the mapping of Time Sheet Detail to Employee Time Reg Buffer
1 2 3 4 5 6 7 8 9 10 11
The mapping of TransferFields(TimeSheetDetail) in table 5510 Employee Time Reg Buffer.
#NameDescription
1Source tableThe table the fields are copied from, on the right: the argument of TransferFields. Its name, with the publisher and the module under it. See Source and target tables.
2Target tableThe table the fields are copied to, on the left: the record TransferFields is called on.
3DirectionPoints from the source to the target. Read from right to left, as the assignment runs.
4SearchKeeps the fields whose name or number matches. Takes the name and number search syntax, such as a range like 1..10.
5Swap source and target tablesSwaps the two tables: x.TransferFields(y) becomes y.TransferFields(x).
6No.The field number. One row per number that either table has, sorted by number.
7Target NameThe target table's field with that number, blank when it has none. An extension icon follows a field that an extension adds.
8Target TypeThe type of the target field.
9Source TypeThe type of the source field.
10Source NameThe source table's field with that number, blank when it has none.
11Mapping iconHow the field transfers; hover over it for the reason. See Mapping icons.

Right-click a row and select Go to Target Field or Go to Source Field, each followed by the field's name in brackets, to open the field. The item is dimmed when that table has no field with the number.

Select source table

Show TransferFields Mapping From… first asks for the source table. The window lists the workspace's tables, except the target table itself, grouped as in the Objects panel.

Picking the source table.
#NameDescription
1Collapse all nodesCollapses every group.
2Expand all nodesExpands every group.
3Toggle search boxShows or hides the search box.
4FilterOpens the filter popup, as in the Objects panel. See Filter popup.
5Group byThe gear. Opens the grouping and sorting popup, as in the Objects panel. See Group by popup.
6SearchNarrows the list by table name or number, as in the Objects panel. See Searching.
7TablesSelect the source table. While you scroll, the group of the top row stays pinned at the top.
8OKOpens the Transfer fields window with the selected table as the source. Enabled while a table is selected; Enter does the same.
9CancelCloses the window without opening the mapping; Esc does the same.

Double-clicking a table does not choose it; select it and then OK.

Source and target tables

The heading over each side names its table, with the publisher and module under it. Hover over it for the table's path, select it to open the table, or right-click it for the table's object context menu.

Opened from the object context menu, the window takes the fields of each table and of every table extension of it in the workspace. Opened from code, it looks the fields up from the app that holds the code.

Mapping icons

The icon between the two sides tells how each field number transfers. Hover over it for the reason.

IconMeaningTooltips
Green checkBoth fields exist, take part and the value can be assigned.Types match; Source dimension fits target dimension; Source enum coerced into target enum
Yellow crossBoth fields exist in the same app, but the types do not match, or one of them cannot take part: a FlowField, or a field with ObsoleteState Removed.Types mismatch; Text overflow; Source field has a flow field class, Target field has a flow field class; Source field is obsolete removed, Target field is obsolete removed
Dimmed crossBoth fields exist, but in different apps, so TransferFields skips them.The type result followed by “however the fields are from different extensions and the mapping is therefore ignored”, or Also, the fields are from different extensions after the reasons above
Hollow circleOnly one table has a field with the number.Source field is not defined; Target field is not defined

Text and Code fields convert into each other; a longer text into a shorter one is a Text overflow. Enum fields count as the same type even when their enums differ.

Filters

The toolbar with the mapping filter open.
#NameDescription
1Toggle showing only extension fieldsShows only the fields that extensions add. Shown when either table has such fields.
2Swap source and target tablesSwaps the two tables.
3SearchNarrows the rows by field name or number.
4Mapping filterNarrows the rows by how they map; see the table below.
5Field selectorWhich side the mapping filter looks at: Any, Both, Source or Target.

The mapping filter lists only the choices that some row matches:

FilterLists
AllEvery field number in either table. The default.
MappedField numbers in both tables that take part.
› Type MatchOf those, the ones whose types match.
› Type MismatchOf those, the ones whose types do not match.
Mapped (Disqualified)Field numbers in both tables that do not take part.
› Module MismatchOf those, the ones whose fields are in different apps.
› Obsolete RemovedOf those, the ones where a field has ObsoleteState Removed.
› Flow Field ClassOf those, the ones where a field is a FlowField.
UnmappedField numbers in one table only.

For › Obsolete Removed, › Flow Field Class and Unmapped, the field selector chooses whether the source field, the target field, both or either must qualify. It offers only the choices that match some row, and is dimmed when Any is the only one.

Check a TransferFields before adding a field

Use this before you add a field to a table that is copied with TransferFields, such as a document line and its posted line.

  1. In the Objects panel, right-click the target table, such as Sales Invoice Line, and select Show TransferFields Mapping From….
  2. Select the source table, such as Sales Line, and select OK.
  3. Select › Type Mismatch in the mapping filter and hover over each icon to read the mismatch.
  4. Select Unmapped to see the fields that exist on one side only. Give a new field the same number on both sides if it should transfer.

The window lists the fields that will not copy as you expect, each with its reason.