attributeIsSelected()

This function can be used in the before, on and after execute hook of the List and Show methods. It cannot be used if the List/Show is implemented as a batch method.

boolean attributeIsSelected(i.componentName,
		i.attributeImplementationName)

Input:

  • i.componentName: the component containing the attribute. Note that for top-down or bottom-up implementations the component name is superfluous. But for batch implementations it is not. For that reason the component name must be specified.
  • i.attributeImplementationName: the attribute implementation name as defined in the BII.

Output:

return value: whether the attribute is selected in the List/Show request.

Example:

if attributeIsSelected(Order, businessPartnerName) then
  ...
Note: Both the component name and the attribute implementation are not (quoted) strings, so do not invoke this function using attributeIsSelected(“Order”, “orderNumber”), but instead useattributeIsSelected(Order, orderNumber).

Also note that the attribute implementation name may differ from the public attribute name, especially if attribute grouping is used. For example, you can use:

attributeIsSelected(Order, Header_IDs_orderNumber).

The return value is true if the attribute implementation is selected, and false if not. In case of derived protected attributes (having an on set hook), selection is also derived from the selection of the public attribute.

For example, for an internalOrderNumber which is derived from the public orderNumber, attributeIsSelected(Order, internalOrderNumber) will return true if attributeIsSelected(Order, orderNumber) returns true.