用来设置某个栏位为必录
可以在A的WHEN-VALIDATE-ITEM里写,实现条件控制B栏位是否为必录。
使用例:
app_fields.set_required_field('WHEN-VALIDATE-ITEM',:block.A is not null,'block.B');
---------------------------------------------------------------------------------------------------------------
附procedure原码:
PROCEDURE set_required_field(event VARCHAR2,
condition BOOLEAN,
field1 VARCHAR2,
field2 VARCHAR2 DEFAULT NULL,
field3 VARCHAR2 DEFAULT NULL,
field4 VARCHAR2 DEFAULT NULL,
field5 VARCHAR2 DEFAULT NULL) IS
value NUMBER;
BEGIN
COPY('Entering app_field.set_required_field. Event is '||event||'.','global.frd_debug');
if (condition) then
value := PROPERTY_ON;
else
value := PROPERTY_OFF;
end if;
if ((not set_property(field1, REQUIRED, value)) or
(not set_property(field2, REQUIRED, value)) or
(not set_property(field3, REQUIRED, value)) or
(not set_property(field4, REQUIRED, value)) or
(not set_property(field5, REQUIRED, value))) then
null;
end if;
COPY('Completed app_field.set_required_field. Event is '||event||'.','global.frd_debug');
END set_required_field;