oracle表单中字段为空时如何提示信息

how to promt a message if a field is empty in oracle forms

如果 oracle 表单中的字段为空,如何提示消息我不确定它是否有效,我使用的触发器是 when-validate-item

begin
  if date = NULL then
    message('please enter issue date')
  else
    null;
  end if;
end;

只需稍微修改一下代码即可

  • 正在将 date = NULL 转换为 :date IS NULL,因为 : 已添加到 代码中的字段名称

  • 加一个额外的message('');正是这个用空格填充 参数) 如果需要 pop-up 消息框

  • 不要忘记当前行末的分号 message(....)

WHEN-VALIDATE-ITEMWHEN-NEW-ITEM-INSTANCE 触发器之一调用

从我的角度来看:

  • 您应该编辑字段的属性并将 required 属性 设置为 yes 让 Forms 担心关于它

  • 如果您坚持要重新发明轮子,那么不要只是显示消息,因为它几乎没有用 - 用户可以忽略它。引发错误,而不是

    if :block_name.item_name is null then
        message('Please, enter issue date');
        raise_form_trigger_failure;
    end if;
    

    将那段代码放入 WHEN-VALIDATE-ITEM 触发器中。