Delete Link

Learn about Delete Link attribute.

To clear a link field, users need to click the Remove Link button (beside the record selector button ). For details on when (Remove Link) is displayed, see Select-Function.

Field contents that were copied via the copyFields property of a Select-Function, are automatically cleared/changed when the respective link is removed or changed.

Use the Delete Link attribute to define a specific Delete function to be called by the Remove Link button , e.g. to

  • clear/reset field values when deleting/changing a link (no matter if a Select-Function was defined or not)
  • change the content of fields previously filled by a Select-Function
  • provide a custom JavaScript function.
Note: After deleting a link it is necessary to save the record to reset the search context. For further details, see Search Context
Note: For non-link fields the Delete Link attribute is only supported if a Select-Function is defined as well, i.e. you cannot use Delete Link to clear e.g. Street when deleting Company in FI: You would have to define a trigger for that instead.
Note: If you use the Delete Function to clear/reset a field that was not copied via copyFields, you also need to explicitly specify the fields copied with copyFields in the Delete Function.

Syntax:

Name

Type

Description

clearFields

function

delete function

fieldIds

int or string

The ID or XML name of the field(s) to be cleared/reset.

value

string

The new value of the field. Use this property to reset a field to some default value.

Examples:

To clear the contents of the Info Area Code and Field Number fields in Z5:

Definition for Info Area Code (Z5/8):

clearFields({

fieldIds: ["TableId","FieldId"],

value: {"TableId": "", "FieldId": "-1"}

});

Definition for Field Number (Z5/9):

clearFields({

fieldIds: ["FieldId"],

value: "-1"

});

If Info Area Code is cleared, both the Info Area Code and Field Number fields are reset; if Field Number is cleared, only Field Number is reset.

To clear a ticket's Priority if another End Customer Company is selected:

Definition for End Customer Company (KM/85):

clearFields({

fieldIds: ["Priority"]

});

To reset FreeC1 in KM to "D" (copied from ABC (FI) via a Select-Function):

Select-Function defined for End Customer Company (KM/85):

selectRecord({

from: {

infoAreaId: "FI"

},

target: {

addLink: true,

copyFields: {

"FreeC1": "ABC"

}

}

});

Delete Link defined for End Customer Company (KM/85):

clearFields({

fieldIds: ["FreeC1","CoGrp2","CoNo2","Company2"],

value: {"FreeC1": "D"}

});

The link and respective key fields ("CoGrp2","CoNo2","Company2") are cleared, FreeC1 ("FreeC1") (containing the company's ABC-Classification) is reset to "D".