Delete Option not Working [message #503610] |
Mon, 18 April 2011 05:41 |
|
shanie
Messages: 118 Registered: January 2011
|
Senior Member |
|
|
Hi,
It is a Students Leave Application form.
Each Student leave application history is maintained.
So One Student has multiple records.
I have Two Blocks. Main Block and Dummy Block.
Main Block is used to enter the Students data.
Dummy Block is used to display the Students data.
When I give Student ID in Main Block and press enter,
It displays previous data in Dummy block.
The Cursor is in the Second field
of the Main Block where we fill the Students Data.
Then the Data is saved and displayed in Dummy block.
When I want to Delete a Record, The Option remove record is
not working in this form.
I write code in key-Delrec trigger also
delete_record;
clear_form;
commit;
But the record is not deleted it remains in database.
When deleting a record Data must be in Main Block.
But the Main block is empty initially.
I don't know what to do to delete a record.
Fields in Main block : Student ID, Name,Noofdays,datefrom,
dateto,official.
Dummy block contains same fields and
displays the student past data.
Please help in solving this delete record issue.
Thanks and Regards,
Shanie
|
|
|
Re: Delete Option not Working [message #503611 is a reply to message #503610] |
Mon, 18 April 2011 05:48 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Are the two blocks database blocks?
From which block are you trying to delete data?
What level is the key-delrec trigger defined at - form or block?
When you press the delete button do you get an error message?
|
|
|
|
|
Re: Delete Option not Working [message #503616 is a reply to message #503615] |
Mon, 18 April 2011 06:44 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
shanie wrote on Mon, 18 April 2011 12:39It gives messages like
Invalid ID Select Active ID from the list.
That's not a form builder error message.
So there must be some code in form causing it.
Find it and tell us what trigger it's in.
|
|
|
|
|
|
|
|
|
|
|
Re: Delete Option not Working [message #503635 is a reply to message #503634] |
Mon, 18 April 2011 09:33 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Validation should only ever be done in validate triggers.
So move those checks to when-validate-record.
Or just set the required property on the items instead.
I never use pre-commit for anything.
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Delete Option not Working [message #503777 is a reply to message #503759] |
Tue, 19 April 2011 12:16 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Delete should not cause when-validate-record to fire.
Check the form_status, block_status and record_status before the delete_record.
Run the form in debug mode to check what triggers are firing.
|
|
|
|
Re: Delete Option not Working [message #503875 is a reply to message #503874] |
Wed, 20 April 2011 03:45 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Is there anything actually stopping you running the form in debug mode direct from form builder?
If there really is then you'll just have to put messages in every trigger to work out what's going on.
|
|
|
|
|
Re: Delete Option not Working [message #503925 is a reply to message #503922] |
Wed, 20 April 2011 08:36 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Put a message in every trigger that displays the name of the trigger.
Also put messages in the delete button before the delete_record command to display the three statuses I mentioned above.
But before that you really should fix the issue with being unable to compile forms in form builder, you can't possibly work efficiently without it.
|
|
|
|
|
|
|
|
|
Re: Delete Option not Working [message #504429 is a reply to message #504413] |
Mon, 25 April 2011 05:05 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
I think that this has gone too far, and (unfortunately) I don't see the light at the end of a tunnel.
The fact is: Forms Builder's "Data Block Wizard" will create both master and detail blocks, relationship between two of them, create all necessary triggers and procedures that will make a form perfectly OK, as far as the default behaviour is concerned. It means that you'll be able to insert records into a table, query existing records, update and delete them. No further coding from your side is necessary.
Now: I have no idea what you were doing in order to spoil those functionalities, but - perhaps you should simply throw existing form away and create a brand new one. Let Wizard do the dirty job. Make sure the form works OK. Then make it fancy, if you want (and know how).
|
|
|