oracle 使用 system.form_status
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3034935/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Using system.form_status
提问by Amir
I try to use system.form_status state, but when I check it after I change some texts or my list item, there is no changes in system.form_status, I just receive "query" message but I must receive "changed" message.
我尝试使用 system.form_status 状态,但是当我在更改某些文本或列表项后检查它时,system.form_status 中没有任何更改,我只收到“查询”消息,但我必须收到“已更改”消息。
So how I can solve my problem? Has it any precondition?
那么我该如何解决我的问题呢?有什么前提吗?
回答by Vincent Malgrat
the status should become CHANGED when you modify a base table item (in a base table block). If you modify an item and the status doesn't change, it must be a control item.
当您修改基表项目(在基表块中)时,状态应该变为 CHANGED。如果你修改了一个项目并且状态没有改变,它必须是一个控制项目。
回答by Jeffrey Kemp
If a control item is modified, the record & block & form status will remain unchanged.
如果控制项被修改,记录&块&表单状态将保持不变。
One way around this is to add a trigger (WHEN-VALIDATE-ITEM) to the item to force the record status to change. In the trigger, set the record status to 'CHANGED'. You may need some logic to take care of new records as well, e.g.:
解决此问题的一种方法是向项目添加触发器 (WHEN-VALIDATE-ITEM) 以强制更改记录状态。在触发器中,将记录状态设置为“已更改”。您可能还需要一些逻辑来处理新记录,例如:
IF GET_RECORD_PROPERTY(NAME_IN ('SYSTEM.TRIGGER_RECORD'),
NAME_IN ('SYSTEM.TRIGGER_BLOCK'),
STATUS) = 'QUERY' THEN
Set_Record_Property (NAME_IN ('SYSTEM.TRIGGER_RECORD'),
NAME_IN ('SYSTEM.TRIGGER_BLOCK'),
STATUS,
CHANGED_STATUS);
ELSIF GET_RECORD_PROPERTY(NAME_IN ('SYSTEM.TRIGGER_RECORD'),
NAME_IN ('SYSTEM.TRIGGER_BLOCK'),
STATUS) = 'NEW' THEN
Set_Record_Property (NAME_IN ('SYSTEM.TRIGGER_RECORD'),
NAME_IN ('SYSTEM.TRIGGER_BLOCK'),
STATUS,
INSERT_STATUS);
END IF;
Alternatively (and this is probably a better method), in your WHEN-VALIDATE-ITEM trigger, set the value of a database item in the same record to some value (as per the other answer here). This will automatically set the record status correctly.
或者(这可能是更好的方法),在您的 WHEN-VALIDATE-ITEM 触发器中,将同一记录中的数据库项目的值设置为某个值(根据此处的其他答案)。这将自动正确设置记录状态。