We help IT Professionals succeed at work.

Oracle Forms

vsarma50
vsarma50 asked
on
I have multiple tabs and each tab has multiple tab pages.
and in each page i have some data.
if have not saved my information after entering the data it should prompt me to save the record.

how can I accomplish this.
thanks very much in advance.
Comment
Watch Question

flow01IT-specialist

Commented:
Normally it would be default forms behaviour to ask if you want to commit the data if you leave a block and there are uncommitted data .

So first some questions
1)  are your blocks and the items in it based on  a database table/view and are the changed  items defined as  a database-field ?
2) are the data of different tab_pages based on the same block ?
3) what should happen if the user doesn't want to save the record ?
   
   

Author

Commented:
1)  are your blocks and the items in it based on  a database table/view and are the changed  items defined as  a database-field ?
yes changed fields are database field.

2) are the data of different tab_pages based on the same block ?
yes different tab pages based on the same block and same record

3) what should happen if the user doesn't want to save the record ?
no i have a button and that button trigger should be fired only if the record is saved.
IT-specialist
Commented:
i don't know if it wil work but have a try

1) avoid navigation to another tab_page  by normal navigation  (next or previous key etc)
       (set next_navigation_item_property of the last item of each  tab_page to the first item of that page,
        set previous_navigation_item_property of the first item of each tab_page to the last item of that page
       
2) if the only way to get to another tab-page is by clicking on a tab then
create a when_tab_page-changed trigger
   
BEGIN
  IF :System.Record_Status IN ('CHANGED', 'INSERT') THEN -- check if the current record is changed
      go_item(:SYSTEM.TRIGGER_ITEM);  -- go back to the item the trigger fired on  
       MESSAGE('Please save record first'); -- show your message
  END IF;
END;

(be sure to read the documentation on the  when_tab_page-changed : avoid navigation that doesn't fire the trigger)