Show TOC

Line Item Actions in TablesLocate this document in the navigation structure

You can add a line item action button as a column within the SmartTable control in both the list report and the object page.

Line item actions are used to trigger actions directly for a single table row. Currently, the following types of line item actions are supported:
  • Actions that trigger a back-end call through the OData service, for example, Approve or Unblock, represented by the complex type DataFieldForAction

  • Actions that trigger navigation, for example, to a different app, represented by the complex type DataFieldForIntentBasedNavigation

To add a line item action to a smart table, within the annotation term UI.LineItem, set the Inline property to true for the complex types listed above. The line item actions are then displayed as shown below:

Figure 1: Line Item Actions (List Report Shown)
Code Sample

The following code sample shows an example of how to create your annotations for line item actions:

UI.LineItem
<Annotation Term="UI.LineItem">
   <Collection>
      <Record Type="UI.DataFieldForAction">
         <PropertyValue Property="Label" String="Copy with new Supplier"/>
         <PropertyValue Property="Action"
            String="STTA_PROD_MAN.STTA_PROD_MAN_Entities/STTA_C_MP_ProductCopywithparams"/>
         <Annotation Term="UI. InvocationGrouping"
            EnumMember="UI.OperationGroupingType/Isolated"/>
      </Record>
      <Record Type="UI.DataFieldForAction">
         <PropertyValue Property="Label" String="Activate"/>
         <PropertyValue Property="Action"
            String="STTA_PROD_MAN.STTA_PROD_MAN_Entities/STTA_C_MP_ProductActivation"/>
         <Annotation Term="UI. InvocationGrouping"
            EnumMember="UI.OperationGroupingType/ChangeSet"/>
      </Record>
      <Record Type="UI.DataField">
         <PropertyValue Property="Value" Path="Product"/>
         <Annotation Term="UI.Importance" EnumMember="UI.ImportanceType/High"/>
      </Record>
      <Record Type="UI.DataField">
         <PropertyValue Property="Value" Path="ProductCategory"/>
         <Annotation Term="UI.Importance" EnumMember="UI.ImportanceType/High"/>
      </Record>
      <Record Type="UI.DataField">
         <PropertyValue Property="Value" Path="to_Supplier/CompanyName"/>
         <Annotation Term="UI.Importance" EnumMember="UI.ImportanceType/High"/>
      </Record>
      <Record Type="UI.DataField">
         <PropertyValue Property="Criticality" Path="to_StockAvailability/StockAvailability"/>
         <PropertyValue Property="Value" Path="to_StockAvailability/StockAvailability"/>
         <Annotation Term="UI.Importance" EnumMember="UI.ImportanceType/High"/>
      </Record>
      <Record Type="UI.DataField">
         <PropertyValue Property="Value" Path="Price"/>
         <Annotation Term="UI.Importance" EnumMember="UI.ImportanceType/High"/>
      </Record>
      <Record Type="UI.DataFieldForAction">
         <PropertyValue Property="Label" String="Copy"/>
         <PropertyValue Property="Action"
            String="STTA_PROD_MAN.STTA_PROD_MAN_Entities/STTA_C_MP_ProductCopy"/>
         <PropertyValue Property="Inline" Bool="true"/>
         <Annotation Term="UI. InvocationGrouping"
            EnumMember="UI.OperationGroupingType/Isolated"/>
      </Record>
      <Record Type="UI.DataFieldForIntentBasedNavigation">
         <PropertyValue Property="Label" String="Manage Products (ST)"/>
         <PropertyValue Property="SemanticObject" String="EPMProduct"/>
         <PropertyValue Property="Action" String="manage_st"/>
         <PropertyValue Property="Inline" Bool="true"/>
      </Record>
   </Collection>
</Annotation>

It is important to note that the UI.LineItem vocabulary term is used to define the columns for the smart table.

In the example above, the order in which the record types are presented in the annotation determines the order in which they appear in the table columns.

For the first two record types, the DataFieldForAction complex type does not contain the Inline property, which means that the action button will appear in the smart table toolbar. If the Inline property is present and set to false, then the action button will also appear in the smart table toolbar.

With the next five record types, the DataField complex type is used to define the data for a column within the smart table.

With the last two record types, the DataFieldForAction and DataFieldForIntentBasedNavigation complex types are used and contain the Inline property which is set to true. Therefore, the action buttons will appear in every row in the appropriate column within the smart table.

UI Annotation in CDS Views

Currently, line item actions are not supported in CDS views. Therefore, you must add the UI.LineItem annotation term to the local annotations file of the application to override the OData service UI.LineItem annotations for the entity type.