Using system.form_status
I try t开发者_开发问答o 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.
So how I can solve my problem? Has it any precondition?
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.
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.:
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.
精彩评论