Skip to main content
Version: v1.0.0(int)

W065: Create material

Creates a new raw-material record. Triggered from the Materials page, "New material".

Steps

  1. Check code uniqueness. Verify code is unique within this org (case-insensitive).

  2. Validate type if supplied. If typeId is set, confirm it exists.

  3. Insert the material. Call Materials.createMaterial.

Returns

The new material.

Business rules

  • Code is unique per org.
  • Type is optional.

Errors

  • ValidationError. Duplicate code.
  • NotFoundError. Type was not found.