Table of Contents

ItemCloning

This rule is triggered when cloning an item.
This happens when :

  • by a user clicking on a Clone button.
  • calling the CloneAsync method

It can be used, for example, to initialize the values the newly cloned item.

Note

The ItemAdded event rule is triggered when cloning.

Warning

When the rule is triggered, the item is not yet added to the view model datasource. Thus, modifying the value of its properties inside an ItemCloning rule does not trigger the associated PropertyChanged rules.

Warning

Cloning an item does not persist it. The item is locally added to the datasource but is not sent to the server until saving.

See this article for more information on event rules execution order.

Arguments

The Arguments property provides the following options.

Name Type Description
Source The type of the UI view model Instance from which the new item is being cloned.
Item The type of the UI view model Item resulting from the cloning operation.
Cancel bool If set to true, the cloning process is canceled.

Item versus DatasourceCurrent

Item refers to the item resulting from the cloning operation. It is the same as using Arguments.Item.

Important

In an ItemCloning event rule, since the new item is not yet added to the datasource, DatasourceCurrent is always different from Item.

To know more on the difference between the Item and DatasourceCurrent properties in an UI view event rule, you can check this article.