Home » Developer & Programmer » Forms » Commit_form not working. Form status not changed (Oracle forms 6i)
Commit_form not working. Form status not changed [message #600728] Mon, 11 November 2013 12:58 Go to next message
amaravaram
Messages: 4
Registered: November 2013
Location: California
Junior Member
I am developing a form where there is an item "STATUS" which is not Visible. I am populating a value in this item based on a value in different item which is visible in the canvas.Please see the code below.

STATUS is a databse item and it needs to be updated. Even after populating updated value in STATUS the form status is not changed and the form is not committed.
WHEN_VALIDATE-ITEM-TRIGGER
BEGIN
-- Validate status
if :B_CONTROL_BLOCK.TI_NEW_STATUS is NOT NULL then

if :B_CONTROL_BLOCK.TI_NEW_STATUS = 'Approved' then
:B_CONTROL_BLOCK.STATUS := 'A';
else
emessage('Please enter a valid status');
raise FORM_TRIGGER_FAILURE;
end if;
end if;


EXCEPTION
when FORM_TRIGGER_FAILURE then
raise;
when OTHERS then
raise FORM_TRIGGER_FAILURE;
END;

Please let me know what to do. Your help is much appreciated.

Thanks
Re: Commit_form not working. Form status not changed [message #600734 is a reply to message #600728] Mon, 11 November 2013 15:53 Go to previous messageGo to next message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
First of all, remove the whole EXCEPTION section (so that Forms could raise an exception if necessary. It might help in debugging process).

Secondly, make the STATUS item visible (so that you could see whether it gets any value or not).

What/who/where commits those changes? WHEN-VALIDATE-ITEM, obviously, doesn't (it can't run restricted procedures anyway).

Recompile the form (All: Ctrl + Shift + K) and run it. Any improvement?
Re: Commit_form not working. Form status not changed [message #600735 is a reply to message #600734] Mon, 11 November 2013 16:16 Go to previous messageGo to next message
amaravaram
Messages: 4
Registered: November 2013
Location: California
Junior Member
Thanks for responding. I have tried making the item visible. It does show the value. I have also removed the exception block. It didn't give me any error.

Please suggest.

Thank yoi
Re: Commit_form not working. Form status not changed [message #600736 is a reply to message #600735] Mon, 11 November 2013 16:19 Go to previous messageGo to next message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
What is the answer to my "commit" question?
Re: Commit_form not working. Form status not changed [message #600737 is a reply to message #600736] Mon, 11 November 2013 16:56 Go to previous messageGo to next message
amaravaram
Messages: 4
Registered: November 2013
Location: California
Junior Member
There is a OK button and in the when-button-pressed trigger I have written Commit_form.
Re: Commit_form not working. Form status not changed [message #600748 is a reply to message #600737] Tue, 12 November 2013 00:55 Go to previous messageGo to next message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
If STATUS really is a database item, then its value *should* be updated. Does STATUS belong to the same table (the one you based this data block on)? You said that STATUS gets its value based on some other item. What happens if you literally type a value into STATUS and then COMMIT?
Re: Commit_form not working. Form status not changed [message #600799 is a reply to message #600748] Tue, 12 November 2013 11:27 Go to previous messageGo to next message
amaravaram
Messages: 4
Registered: November 2013
Location: California
Junior Member
Yes it belongs to same table as the data block. When I type commit it is working fine. Please let me know if I am missing something.
Re: Commit_form not working. Form status not changed [message #600846 is a reply to message #600799] Wed, 13 November 2013 01:52 Go to previous message
azamkhan
Messages: 557
Registered: August 2005
Senior Member
Is you form always displaying your custom message which is as follows:

'Please enter a valid status'
Previous Topic: why it showing messages like this?
Next Topic: WUO-700: Unable to create the OLE Server Word.Application; Exception com.jacob.com.ComFailException
Goto Forum:
  


Current Time: Thu Apr 25 12:18:40 CDT 2024