· Nov 18, 2022

Trigger, Insert after

Hi, how do I create a trigger that will only set the value of the "Status" field for new objects, not for all available?

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
Discussion (2)1
Log in or sign up to continue