Delete Selection

This command is used to delete the selected resources. Resources can be selected using the Select or Select Children commands.

All dependent data for the selected resource including quantity values and relations are also deleted..

If the resource is a component which forms part of an Allocation, the related Allocation resources and quantities for those Allocations are also deleted. This applies recursively, such that if a deleted resource is a component of an Allocation, and that Allocation is also a component of another Allocation, all the related resources are deleted.

The successful deletion of the selected resource clears the selection and the $selection_size variable is set to 0.

Syntax
Delete Selection;
Log message
The number of resources to be deleted is reported in the log message.
APACS262=Deleting {0} selected resources.

{0} = number of resources in the selection.

Example of model fragment:

model fragment

Possible scenarios:

  • Delete the single resource for class “Products” with name “PRODUCT A”:
    Select: Products.name = PRODUCT A;
     Delete Selection;
    
    • This removes the “Products” resource with name “PRODUCT A”, and additionally, based on the model example.
    • The quantities for the deleted resource are removed.
    • The child relationships to “Products At Suppliers” for the delete “Products” resource are deleted.
    • These allocations for which the delete resource is a component, are deleted:
      • “Products At Locations” resources which have the deleted “Products” resource as a component.
      • “Supplier Allocations” resources which have the deleted “Products At locations” resources as a component.
      • The parent relationships to “Products At Suppliers” for the deleted “Supplier Allocations” resource.
  • Delete all resources for class “Supplier Allocations” which have a type attribute value “X”:
    Select: Supplier Allocations.type = X;      
     Delete Selection;
    
    • This removes the “Supplier Allocations” resources with type “X”, and additionally, based on the model example.
    • The quantities for the deleted resource are removed.
    • The parent relationships to “Products At Suppliers” for the deleted “Supplier Allocations” resources are deleted.
    • Relationships to components “Suppliers” and “Products At Locations” for the deleted “Supplier Allocations” resources are deleted.