This content has been marked as final. Show 7 replies
thank you for your reply. The problem is still not solved i set the message level accordingly but still i am getting No Changes to be saved forms default message
Please note that its working fine when single form is running but if more then one forms are open then for each form if it has not changed the same message appears.
Your code doesn't make sense to me.
You're already in the current form so this instruction is redundant and could result in opening a new instance of the existing form. This new form instance would have a FORM_STATUS=QUERY or NEW.
Pavan's suggestion should work, but you may need to also check the BLOCK_STATUS and RECORD_STATUS system variables. I have seen Forms report the FORM_STATUS = QUERY when the BLOCK_STATUS was CHANGED. Consider changing your Save Button code to something like:
Hope this helps,
BEGIN IF ( :SYSTEM.FORM_STATUS = 'CHANGED' OR :SYSTEM.BLOCK_STATUS = 'CHANGED' OR :SYSTEM.RECORD_STATUS = 'CHANGED' ) THEN COMMIT_FORM; ELSE Message('No changes to be saved.'); END IF; END;
Thank you craig,
Again i am trying to explain my problem i hope i do it. I have let say 4 or 5 opened forms opened in Multi forms application (forms are opened using open_form built-in and all forms sharing same session) and among them one is active form on which user making changes and then from menu select save. Now only one form has been changed and the status of remaining opened forms are query or new, as user select save then system first throwing message of No "changes to be saved" and in the last saves and applies the changes and it displays last message changes applied and saved. As there any way that i could apply commit only on active form.
Well, as you are finding out - Forms keeps track of the changes in each form seperately. In order to issue the commit in your form that has changes, you will need to navigate back to the form with uncommited changes. Knowing which form has changes is up to you to keep track of in your application. However, as your user closes each form they will be prompted to save if there are uncommited changes.
If you don't want the "No Changes to apply" message to display, you can trap this message in the On-Error trigger and simply ignore it. For example:
/* Sample On-Error Trigger */ BEGIN IF ( ERROR_TYPE = 'FRM' AND ERROR_CODE = 40405 ) THEN NULL; END IF; END;
Thank You craig!
Your suggestion is working nicely. To display a custom message to user if form has not been changed i wrote few lines of code in key-commit trigger which first check if form status has been changed than calls commit_form other wise display a message to user that no changes found to be saved.