Trigger, Insert after
Class CarDealer.Order Extends (%Persistent, %Populate)
{
Property Title As %String
Property Status As %String(VALUELIST = ",InProgress,Done,Canceled");
Trigger setStatus [ Event = INSERT, Foreach = row/object, Time = AFTER ]
{
&sql(update CarDealer.Order set Status = 'InProgress')
}
Product version: IRIS 2022.1
Is that what you want to do, or should you be defining your property as:
Property Status As %String(VALUELIST = ",InProgress,Done,Canceled") [ InitialExpression = "InProgress" ];
This makes InProgress the default status when a new CarDealer.Order is created.
Since Trigger code is called after validation and constraint checking, a trigger should not be used to change column values. David's solution is better.