Instance Command

Visual LANSA Framework

Instance Command

Select this option if you want the selected command to apply to the instances of the business object.  Instance commands are displayed when you right-click an instance in the Instance List.

Whether a command is best implemented as applicable to the business object itself or its instances depends on the context.

For example, let's assume you have a business object Employee with instances such as 'employee A1234 Veronica Brown'.  To allow the user to enter new employees, you would create the command New. Logically this command applies to the business object itself, Employee. Therefore, you do not select the Instance Command option for command New.

To view details of an individual employee (in other words an instance of the Employee business object) you could add a command Details. You need to make this command an instance command because it will display details of the individual employees (such as phone number, salary etc.), not about the business object. So for Details you would select the Instance Command option.

An instance command handler can be written in such a way that it processes several instances at once. To see how this works see the Programming Techniques application -> Basic -> Selected, Current or All Entries.

This property is in the Commands Enabled tab.