Home » Developer & Programmer » Forms » want to check for checkbox status with one more corresponding value (FORM 4.5)
want to check for checkbox status with one more corresponding value [message #518348] Wed, 03 August 2011 05:37 Go to next message
umesh337
Messages: 26
Registered: July 2011
Location: pune
Junior Member
Hi all,

I was working with forms and found a problem related to accessing of status of checkbox.
In a block with multirecord to be checked, if we want to check all the checkbox status which is already clicked, Then what should i do.
Now i am using the function Checkbox_check as:
if Checkbox_Checked('FVA.STATUS')
But the problem with this function, it is giving status of last clicked checkbox only.

So please guide me.
Thanks.
Umesh
Re: want to check for checkbox status with one more corresponding value [message #518350 is a reply to message #518348] Wed, 03 August 2011 05:55 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Multirecord => loop through all of them, check checkbox status in a current record.

[EDIT] Sample code from the recent discussion.

[Updated on: Wed, 03 August 2011 05:56]

Report message to a moderator

Re: want to check for checkbox status with one more corresponding value [message #518371 is a reply to message #518350] Wed, 03 August 2011 07:54 Go to previous messageGo to next message
umesh337
Messages: 26
Registered: July 2011
Location: pune
Junior Member
Hi Littlefoot,

Thanks for the reply.
But i think the problem is something like below:

let us take a block named ABC is there.
and it has multi-record with three item each.

1> checkbox (label - 'STATUS')
2> numer text item(label - 'Dept_no' where its value in 1 to 10)
3> name (no matter what it be)

Now the user will check some checkboxes among them.
If the user tries to save that changes then the code will check for any record where status= 'checked' and dept_no=5.

So how we could implement that.

Thanking in anticipation.
Regards,
Umesh
Re: want to check for checkbox status with one more corresponding value [message #518397 is a reply to message #518371] Wed, 03 August 2011 09:00 Go to previous messageGo to next message
umesh337
Messages: 26
Registered: July 2011
Location: pune
Junior Member
Hi Littlefoot,

This all the steps to be performed in PRE-COMMIT which is not permit as illegal procedure of GO_BLOCK.

So please suggest something accordingly.

Thanks in advance.
Re: want to check for checkbox status with one more corresponding value [message #518401 is a reply to message #518397] Wed, 03 August 2011 09:19 Go to previous messageGo to next message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
What exactly are you trying to check here?
Re: want to check for checkbox status with one more corresponding value [message #518405 is a reply to message #518401] Wed, 03 August 2011 09:34 Go to previous messageGo to next message
umesh337
Messages: 26
Registered: July 2011
Location: pune
Junior Member
Hi cokiemonster,

I want to put some error message if the dept_no=5 and status of the checkbox is checked.

Thanks.
Re: want to check for checkbox status with one more corresponding value [message #518407 is a reply to message #518405] Wed, 03 August 2011 09:38 Go to previous messageGo to next message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
So what's wrong with checking that in when-validate-record?
What difference does having multiple records in the block make?
Re: want to check for checkbox status with one more corresponding value [message #518412 is a reply to message #518407] Wed, 03 August 2011 10:17 Go to previous messageGo to next message
umesh337
Messages: 26
Registered: July 2011
Location: pune
Junior Member
But if i will check it by WHEN-VALIDATE-RECORD, then it will check at the time of changes applying on the form.
And the requirement is to check this just before commit only.
Which i am doing in pre-commit trigger.

Thanks for your replies.
Re: want to check for checkbox status with one more corresponding value [message #518413 is a reply to message #518412] Wed, 03 August 2011 10:22 Go to previous messageGo to next message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
Why do you want to do this check (whatever it is, you still haven't explained properly) before commit?
Why is multiple records relevant?
If you don't explain what you are trying to achieve we really can't help you.
Re: want to check for checkbox status with one more corresponding value [message #518421 is a reply to message #518413] Wed, 03 August 2011 14:52 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:
the requirement is to check this just before commit only.

That doesn't sound reasonable. Imagine someone who enters tons of records, quite a few of them being checked and having DEPT_NO = 5. He/she would be very happy if you raised a warning at the moment the record was entered (WHEN-VALIDATE-RECORD), instead of much later, when COMMIT is to be done. You'll do - what? Inform the end user that "there are 13 records whose values are invalid - go back and fix them"? How is he/she supposed to do that? Scroll up and down, losing precious time for nothing?
Re: want to check for checkbox status with one more corresponding value [message #518461 is a reply to message #518401] Thu, 04 August 2011 00:46 Go to previous messageGo to next message
umesh337
Messages: 26
Registered: July 2011
Location: pune
Junior Member
Hi Cookiemonster,

let us take a block named ABC is there.
and it has multi-record with three item each.

1> checkbox (label - 'STATUS')
2> numer text item(label - 'Dept_no' where its value in 1 to 10)
3> name (no matter what it be)

Now the user will check some checkboxes among them to change the status from G to V.(previously the status value is G and after pressing the save button on tool bar it will become V.)

Now the issue is when the user going to click save button it must check where status= 'checked' and dept_no=5.
If the code get any of this kind of record then it will throw the error message and come back to same screen.
If it does not get any that kind of record then it will save the changes and the record will be out of the list in the block.

This is the whole scenario i have.
So please provide a solution regarding this.
Any further clarification need please ask from this functionaliy given.

Thanks.

Re: want to check for checkbox status with one more corresponding value [message #518469 is a reply to message #518461] Thu, 04 August 2011 01:17 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I'm not Cookiemonster, but nevertheless: I still think that what you are trying to do is wrong (but who am I to judge?). Anyway, you're then back to the first reply in this discussion - loop through all records.
Re: want to check for checkbox status with one more corresponding value [message #518477 is a reply to message #518469] Thu, 04 August 2011 01:42 Go to previous messageGo to next message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
If I'm understanding you correctly then you want to raise an error when any record is checked and has a dept_no of 5. In which case the amount of records is irrelevant.
In which case the only sensible thing to do is do the check in when-validate-record.
You can't do it in pre-commit so stop trying.
Re: want to check for checkbox status with one more corresponding value [message #518478 is a reply to message #518469] Thu, 04 August 2011 01:44 Go to previous messageGo to next message
umesh337
Messages: 26
Registered: July 2011
Location: pune
Junior Member
Hi Littlefoot,

You are right. I need to use the loop anyhow.
But this checking functionality is to be run in PRE-COMMIT trigger as when i am pressing the button SAVE it is executing the pre-commit trigger for the validation purpose.

And the loop solution you provided me in your last reply was using navigation of cursor through the form which is not legal in PRE-commit trigger.

Thats why i came back again to the beginning of validating the checkbox in this level. Sad

Thanks for your anticipation.
Re: want to check for checkbox status with one more corresponding value [message #518480 is a reply to message #518478] Thu, 04 August 2011 01:47 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Why in PRE-COMMIT? You said:Quote:
... when i am pressing the button SAVE ...
This is the WHEN-BUTTON-PRESSED trigger, which allows restricted procedures.
Re: want to check for checkbox status with one more corresponding value [message #518504 is a reply to message #518480] Thu, 04 August 2011 03:34 Go to previous messageGo to next message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
But then you've got the usual problem of "Do you want to save changes?"
Re: want to check for checkbox status with one more corresponding value [message #518833 is a reply to message #518504] Mon, 08 August 2011 00:08 Go to previous messageGo to next message
umesh337
Messages: 26
Registered: July 2011
Location: pune
Junior Member
Hi Cookiemonster/littlefoot,

Thanks for your valuable suggestions.
I have solved this problem by putting WHEN-VALIDATE-RECORD trigger in the block level where i need to check the condition.

Regards,
Umesh
Re: want to check for checkbox status with one more corresponding value [message #518885 is a reply to message #518833] Mon, 08 August 2011 04:33 Go to previous message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
thanks for letting us know.
Previous Topic: convert from 6i to 10g
Next Topic: frm-40654 Record has been updated by another user.Re Query to see change
Goto Forum:
  


Current Time: Sun Sep 08 23:03:58 CDT 2024