Custom operations

The custom operation is a functionality available in at least two components.

You can create your own custom operations that you can use directly in a component together with toolbar buttons when updating, creating, or copying data, instead of using a dialog. Custom operations can be used in the components index list, details header, form, data grid, chart, dialog, and media.

To create a custom operation, first, create the data service you want to use for the operation. Next, open the configuration of the component. Click Operations > Custom. Click Add to add a custom operation. Specify a suitable name for the operation. See Naming recommendation for custom operations. To connect the data service you want to use, click Data Service and select from the list of data services.

Below is an example:

You have a data grid listing items, and you want to be able to update the statuses of the items to Released or Discontinued by clicking two buttons without opening a dialog. The buttons are called Update to Released and Update to Discontinued.

First, you create two data services, one for updating items to status 20 called Update_ItemReleased, and one for updating to status 50 called Update_ItemDiscontinued. Then, you create a custom operation called Operation_UpdateDiscontinued, connect the Update_ItemReleased data service to it, and create an interaction to trigger this operation when you click Update to Released. Finally, you create a second custom operation called Operation_UpdateDiscontinued, connect the Update_ItemDiscontinued data service to it, and create an interaction to trigger this operation when you click Update to Discontinued.

Now, when you select an item in the data grid and click on one of the buttons, the status of the item is updated accordingly.