W065: Create material
Creates a new raw-material record. Triggered from the Materials page, "New material".
Steps
-
Check code uniqueness. Verify
codeis unique within this org (case-insensitive). -
Validate type if supplied. If
typeIdis set, confirm it exists. -
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.