Skip to content

ValidationReport ^v2.7.197 ​

The result of validating a HierarchyBlueprint.

js
const report = blueprint.validate("Account", "Default");

if (!report.ok()) {
    script.fail("The blueprint has " + report.messages().length + " problems.");
}

Constructor ​

Returned by HierarchyBlueprint.validate(). It can't be created directly.

Overview ​

  • Errors vs warnings: ok() only looks at errors. A report can be ok() and still have warnings or information worth reading in messages().
  • Strict publishing: a blueprint in "STRICT" mode won't publish while ok() is false.

Methods ​

ok ok() boolean ​

Returns true when there are no error-level messages.

messages messages() array ​

Returns every message the validation produced. Each message has:

  • severity: "ERROR", "WARNING" or "INFO".
  • code: a short code, such as "CYCLE", "SELF_PARENT" or "DUPLICATE_LINK".
  • message: a readable description.

elementCount elementCount() number ​

Returns the number of distinct elements in the blueprint.

linkCount linkCount() number ​

Returns the number of parent-child links in the blueprint.

rootCount rootCount() number ​

Returns the number of top-level elements, those with no parent. A blueprint with no roots usually means there's a cycle.