Default entity

The default entity for a hook is created by DevOps Plan before a hook starts, and represents the current record upon which an action is being done.

For Perl, you retrieve this object using:

$entity

If you are referencing another entity in the context of one record's action (such as executing a call to the BuildEntity method to submit a new record), you need to maintain the scope of your entity variables. There are two approaches:

  • Use the same variable name for both entities, but declare one of them using my. That makes only one of them accessible at any time, because the my declaration creates a new variable with local scope which masks the existing global definition until the variable goes out-of-scope (for instance, at the end of the current function).
  • Use different variable names for each entity.