selectRecord for Standard Link Fields

Learn about selectRecord function for Standard Link Fields.

Syntax

Use the syntax described in the article “How to Use Record Selector” at https://support.aurea.com.

Note:
  • Use XML names in (double) quotes for specifying fields.
  • To copy the text value of a catalog, use "" and prefix the field number with a "T" e.g. "T5".
  • If defined, the search context is displayed in a drop-down list on the search mask. For further details, see Search Context. Use the same syntax as described for the SearchContext control attribute. For further details, see SearchContext.
  • When searching in the same info area as the current record (e.g. the Predecessor fields in KM and IB), the search context is automatically created, even if not specified in the Select-Function: The drop-down list contains "Entire database" plus the parent record(s) of the current record).
  • filterFields parameter: Filters on decoded fields (Z-fields) are not supported.
  • Use the SDK page to test your selectors: Selectors > Select Records

Example

Linking a marketing activity record to an activity (-> Marketing Activity field in MA)
selectRecord({
          from: {
          infoAreaId: "AK"
          },
          target: {
          addLink: true
          }
          });
Selecting a Postal Code when creating/editing a company record (Postal Code field in FI)
{
          from: {
          infoAreaId: "OR",
          searchAndListName: "OR-Link",
          filterFields:
          {
          Country: {
          source: "target",
          fieldId: "Country"
          },
          FromPC: {
          source: "target",
          fieldId: "ZipCode",
          compareOperator: "<="
          },
          ToPC:{
          source: "target",
          fieldId: "ZipCode",
          compareOperator: ">="
          }
          }
          },
          target:
          {
          copyFields:{
          Country: "Country",
          ZipCode: "FromPC",
          City: "City",
          AreaCode: "TelPrefix"
          }
          }
          });

This definition uses a specific Search control definition ("OR-Link"). After selecting a record the values for Postal Code, City, Country and Area Code are copied from OR to the corresponding fields in FI (copyFields).

Selecting an Activity template with Live Calculations (Using the delayChangeNotification parameter)

The following sample shows the usage of the delayChangeNotification parameter. This is useful when the copyFields is used with Live Calculations. The field values are evaluated everytime the field change event is fired and overwrites the values already set in the previous fields. This parameter ensures that the change event is triggered after all the fields are set.

In the sample shown below, default-values trigger is used in MA that sets the start of the activity to current day and time and sets the end time of the activity after a duration of one hour. It also uses a Activity Template (A031) that uses a duration that is different from the default value trigger. By using the delayChangeNotification parameter, you can ensure that when a new activity is created using the template, the end time of the activity is set according to the template and not the default value trigger.
selectRecord({
          from: {
          infoAreaId: "A031",
          useAutoSearch: true
          },
          target: {
          delayChangeNotification: true,
          addLink: true,
          copyFields: {
          "6005": "6002",
          "3": "7001", //start at
          "6": "7002", //end at
          "4": "F7004", //duration
          "5": "7005" //unit,
          }
          },
          findAsYouType:{
          searchFields:[6000],
          textFields:[6000,7001,7002]
          }
          });
FS version - Selecting a bank account for a product (Bank A/C Details field e.g. in KT)
selectRecord({
          from: {
          infoAreaId: "BV",
          searchContext: {
          items: ["FI"]
          }
          },
          target: {
          copyFields: {
          "SortCode": "SortCode",
          "Institute": "Institute",
          "Branch": "Branch",
          "AcNo": "AcNo",
          "BankDetailsStatNo": "StatNo",
          "BankDetailsSeqNo": "SeqNo"
          },
          }
          });

Only bank accounts linked to the same company as the product can be selected (searchContext).