Skip to main content

What you will build

An Update template for a Contract class with a required name, customer reference, review notes, and one explicit save button. Start with the form; add related objects, searches, and scripts after this version saves correctly.

Prepare the class and access

You need caseflow-configuration.manage to author templates. Prepare a class with these attributes and an existing test object: Use the exact attribute names from your class. Template labels can be friendly text, but attributeName must resolve to the configured attribute. The test account also needs permission to open and update the object.

Open the editor

Under Settings → Admin → Caseflow → Templates, select the application and class, then create an Update template. Name it Contract review. The editor combines template settings, source, component help, validation problems, and a preview. A starter or Scaffold from class gives you a starting point. Loading a starter changes the draft; it does not save it. Review its placeholder names against your class.

Add the form

Use this complete starting template:
The first line is a supported template directive. It hides the host’s default submit button because the template supplies its own SaveButton. Keep the directive exactly as shown. The form’s required rule improves the editing experience. It does not replace API validation or an access rule for other callers.

Preview and resolve problems

Use the preview to inspect spacing, labels, and the selected template type. Use the Problems panel to locate unknown attributes, misspelled component names, and invalid properties. Component help supplies the supported properties; do not assume an arbitrary HTML attribute is a component option. The preview offers Sample data and Real object. Saving, scripts, and other side effects are blocked in preview mode, even if a control is displayed. A preview is useful for layout and bindings. Verify saving on an actual test object as well: a good-looking form is not evidence that its user can update the class.

The complete example beside its generated sample-data preview. Save review is blocked in preview.

Save and verify selection

Save the template, then open the test object through the normal Caseflow surface. Check:
  1. The intended Update template is selected for the account.
  2. Existing values appear in all three fields.
  3. Clearing Name prevents the form’s required-field validation from passing.
  4. Saving an edited review note persists it; reopening the object shows the new value.
  5. An account without update rights cannot gain write access through the template.
If the wrong template opens, inspect its type, class, default fallback, group assignments, and precedence. An explicit template name in a link or component can select a specific template. See template selection.

Compare and restore a saved version

Open History while editing an existing template. Select a saved version to compare it with the current draft.
  • Load into editor changes the draft only. Review the preview and save when ready.
  • Restore is a server-side change: it overwrites the saved template with the selected version and creates a new history entry. Current group assignments remain unchanged. Read the confirmation before proceeding.
If a restore reports a precedence conflict or concurrent change, resolve that condition and reload the current version before trying again. Do not assume a failed restore changed the saved template.

Use AI assistance for a bounded change

When AI template assistance is available to your group, open its panel and describe the business form and the change you want. You still need permission to manage Caseflow templates. A useful request is: “Keep the current Contract form. Put the customer reference beside the contract name and move Review notes below them. Keep the existing attribute bindings and Save review action.” The proposal appears as a diff against your draft. Accept brings it into the editor; Discard leaves the draft unchanged. Acceptance does not save the template. Inspect the Problems panel and preview, then verify saving with a real test object. If the draft changed during generation, compare against the current text before accepting. Generated code can need further correction even after syntax checks pass. Begin with a starter or Scaffold from class when a standard layout is sufficient.

Extend one behavior at a time

  • Add a RelationPicker when the customer is a related object rather than text.
  • Add an ObjectSearch for child records, with an explicit filter linking them to the current object.
  • Add a script-backed autofill to normalize the reference, then verify the script’s target attributes and published version.
  • Add an onBeforeSave hook for a form business rule, and test both the successful and rejected paths.
Keep the basic save path working after each addition. Use template history to inspect changes, and test restored content before applying it to live work.

Templates and syntax

Learn how Caseflow templates work — types, selection, syntax for variables, conditionals, loops, and the scope model.