Home » Developer & Programmer » Forms » check all checkboxes i.e non data databse item after execute query
check all checkboxes i.e non data databse item after execute query [message #626619] Thu, 30 October 2014 01:17 Go to next message
jgjeetu
Messages: 373
Registered: July 2013
Location: www.Orafaq.com/Forum
Senior Member

I have made a EMP block which is based on emp table, i have made one checkbox item in EMP Block which is non database item,
There is one more block CTRL which is non database datablock, there is one push button on CTRL block, when we press that button , it goes to emp block and executes query , my requirement is , all checkboxes should be checked after execute.
i have written followng code on push button i.e
go_block('emp');
execute_query;
:EMP.CB:='1';

but the problem is it checks only first record , the remaining records remain unchecked.
Please tell me how to solve that. Please find the attachment.
Thanks
  • Attachment: CB.fmb
    (Size: 44.00KB, Downloaded 1203 times)
Re: check all checkboxes i.e non data databse item after execute query [message #626622 is a reply to message #626619] Thu, 30 October 2014 01:47 Go to previous messageGo to next message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
One option is to loop through all records in that block and set CB to 1.

Another (probably simpler) one is to create a POST-QUERY trigger and set CB to 1:
:EMP.CB := '1';
Re: check all checkboxes i.e non data databse item after execute query [message #626627 is a reply to message #626619] Thu, 30 October 2014 02:25 Go to previous messageGo to next message
azamkhan
Messages: 557
Registered: August 2005
Senior Member
On Post-Query Trigger assign the checked value to the check box
Re: check all checkboxes i.e non data databse item after execute query [message #626642 is a reply to message #626622] Thu, 30 October 2014 03:59 Go to previous messageGo to next message
jgjeetu
Messages: 373
Registered: July 2013
Location: www.Orafaq.com/Forum
Senior Member

sometimes easy thing seems so disfficult anyways thanks @lf &azamkhan , you guys have solved my big problem. Smile
Re: check all checkboxes i.e non data databse item after execute query [message #626643 is a reply to message #626642] Thu, 30 October 2014 04:02 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
if you're setting an items value in post-query then you should run
set_item_property(<item name>, item_is_valid, property_true);

afterwards
Re: check all checkboxes i.e non data databse item after execute query [message #626645 is a reply to message #626643] Thu, 30 October 2014 05:11 Go to previous message
jgjeetu
Messages: 373
Registered: July 2013
Location: www.Orafaq.com/Forum
Senior Member

@cm i am not facing any issue now but if will then i will try your suggestion, i created post query trigger on database block & everything is working fine now.
actually i just took an idea through this post.
the real query is :-
There is an application for making payment to applicants.
using some conditions we fetch data in that block,
but the problem is if there are 1000 records and user want to make payment for 2 applicants only , then he had to find those records out of 1000 record then he chekcs the check button for those 2 records and there was button , when user presses that button the payment get made for applicants which is time taking & difficult task from user point of view .
then
i added one block for searching records and used where clause on database datablock.
then user again demanded that after filtering record the checkbox should be checked automatically .
in that case i was facing issue , my query was checking only first check box.
but the idea that you guys gave me worked very well.

I tried to explain in short, otherwise i am doing these things on accounts module in Vouchers section.

hope i have explained , what i was trying to do and how much you guys have helped me . thanks Smile

[Updated on: Thu, 30 October 2014 07:24]

Report message to a moderator

Previous Topic: set Financial Year
Next Topic: Webutil - Problem with files having an 4 characters file extension
Goto Forum:
  


Current Time: Thu Apr 25 06:21:26 CDT 2024