Register and activate a customer extension

Attach a customer extension to a published hook point, have it reviewed, and activate it only after an independent approver agrees.

Required permission: Operator (register, disable); Release manager (review); Independent approver (activate); Configuration owner (back to draft)

Before you begin

An extension is a customer-written function that runs at a published hook point, such as after a customer is saved. It lives under custom_modules and is registered here before it can run. Extensions may only write their own fields, named with their namespace.

The five published hook points (version 1) are partner.after_save, product.after_save, document.before_confirm, document.after_confirm and report.columns. Points that protect access, posting, periods, audit or tenancy cannot be used: 'That point protects access, posting, periods, audit or tenancy. No extension can attach to it.'

Note:

At present no module calls the hook points yet, so an active extension's Calls counter stays at 0. You can register and activate extensions, but they do not run.

Register

  1. Open Platform > Packages > Extensions and press New.
  2. Enter the Namespace: lower case, x_ followed by a letter, then letters, digits or _, 3 to 30 characters (x_acme). It must be unique per hook point.
  3. Choose the Hook point. Namespace and hook cannot change later.
  4. Enter the Name (defaults to the namespace).
  5. Enter Core versions using the same range grammar as packages (1).
  6. Enter Permission needed if the extension requires one, as a permission code such as contacts.edit.
  7. Enter the Function in the form custom_modules.<package>.<module>:<function>, for example custom_modules.acme.hooks:on_save.
  8. Enter Its fields, one per line as model field, for example contacts.partner x_acme_tier. A field must be named <namespace>_ followed by 1 to 30 lower-case characters, and the model must be one the hook works on.
  9. Save. The extension is a Draft.

The Checks tab lists anything that still stops activation.

Review and activate

  1. A release manager presses Review. It is refused with the first open problem until the checks pass, including the core versions: 'Say which core versions it supports.'
  2. An independent approver other than the registrar presses Activate. The registrar is refused with 'Somebody other than the person who prepared this extension must approve it.'
  3. Activation also imports the function. If it cannot be loaded the refusal reads 'The function cannot be loaded: ...' and the extension stays reviewed.

What happens next

The extension is Active. The Overview tile Active extensions shows active over total. The list shows the Calls and Failures counters, and the record shows the last error.

Disable or change

  • An operator presses Disable. The extension's data stays readable.
  • A configuration owner presses Back to draft to allow edits, then it must be reviewed and activated again.
  • An active extension cannot be edited.

Refusals you may see

MessageMeaning
'A namespace starts with x_ and is lower-case, such as x_acme.'The namespace format is wrong.
'This namespace is already registered on that hook.'Use another namespace or hook.
'The function lives under custom_modules: custom_modules.acme.hooks:on_save.'The function path must start with custom_modules..
'An extension writes only its own registered fields, named x_acme_...'A listed field is a core field or does not use your namespace.
'This hook works on contacts.partner.'The field belongs to a model the hook does not handle.