kinderproc
kinderproc

Reputation: 308

How to keep initial value of a field after POST is done

I have an Oracle Forms app. There is a form with a date field and I need to keep it initial value (when form is loaded), to compare it with actual value in the field. Also there is a button on the form, that posts changes.

I've tried to store initial value with global variable and check if it's changed, also I've tried to simply check that :system.record_status != 'QUERY' to track if date is modified.

Problem that at the moment, when button is pressed and post is done the values of all global variables become null, so I can't compare the initial value with the new one and :system.record_status becomes 'QUERY' again, and I don't see any more if user modified something.

How to keep the initial values or track that data was changed, doesn't matter if user posts changes or not?

Upvotes: 1

Views: 514

Answers (2)

Littlefoot
Littlefoot

Reputation: 142705

This:

Problem that at the moment, when button is pressed and post is done the values of all global variables become null, so I can't compare the initial value with the new one

doesn't work that way. Post (if you refer to POST built-in) (nor COMMIT, as we're at it) doesn't clear global variables. Explicitly setting it to NULL does, so - check the form whether you've done it somewhere in your code. How? Run the form in debug mode, trace its execution and see what's going on.

Another thing that might be going wrong is that global variables's datatype is CHAR so - if you plan to compare it to a different datatype value, you should perform conversion. As it is a date value, consider applying TO_DATE function to the global variable with appropriate format mask.

Upvotes: 1

Nikhil
Nikhil

Reputation: 3950

this will work:

     IF GET_ITEM_PROPERTY(:SYSTEM.CURSOR_ITEM,UPDATE_COLUMN) ='TRUE' THEN
     Copy(Get_Item_Property(itm, Database_Value), :System.Cursor_Item);

Upvotes: 1

Related Questions