To modify the definition of a data block:
You can also dynamically prevent users from entering a new record by implementing a When-New-Record-Instance trigger that does the following:
IF ((dynamic-condition-is-true) AND
:System.Record_Status = 'NEW')
THEN
RAISE Form_Trigger_Failure;
END IF;
You can also dynamically make an entire block query-only at runtime by implementing the following:
Set_Block_Property('blockname', INSERT_ALLOWED, PROPERTY_OFF);
Set_Block_Property('blockname', UPDATE_ALLOWED, PROPERTY_OFF);