views:

131

answers:

2

Dear friends
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.

So how I can solve my problem?has it any precondition?

+2  A: 

Hi rima,

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.

Vincent Malgrat
yes I use control item,for control them what should i do?plz help me.
rima
@rima: In that case don't use `:system.form_status`. You can check if the values have been modified (are they different from the default value?)
Vincent Malgrat
aha,I got it.Thanks dude
rima
+1  A: 

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.

Jeffrey Kemp
this solution did not work!would u explane more to me plz?maybe I do in wrong way...
rima
ok, I don't have a Forms environment I can test this on right now. I wrote this off the top of my head so I don't know if it will work or not. If you want to give this a go, can you do some troubleshooting? 1. is there any error when the trigger fires? 2. is the trigger actually firing at all? 3. what is the status of the record before and after the trigger runs the code (i.e. what does `GET_RECORD_PROPERTY(NAME_IN ('SYSTEM.TRIGGER_RECORD'),NAME_IN ('SYSTEM.TRIGGER_BLOCK'),STATUS)` return)?
Jeffrey Kemp