Home » Developer & Programmer » Forms » how to check if all the records in a form was filled by the user (oracle )
how to check if all the records in a form was filled by the user [message #674845] Tue, 19 February 2019 06:51 Go to next message
minnu
Messages: 4
Registered: February 2019
Junior Member
how to check if all records have been inserted in an oracle form then display the status item as entered
Re: how to check if all the records in a form was filled by the user [message #674849 is a reply to message #674845] Tue, 19 February 2019 08:06 Go to previous messageGo to next message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
Given that users can enter as many or few records as they like - Define what you mean by all records.
Re: how to check if all the records in a form was filled by the user [message #674864 is a reply to message #674849] Tue, 19 February 2019 22:01 Go to previous messageGo to next message
minnu
Messages: 4
Registered: February 2019
Junior Member
I have a form where the user has to enter name,address, lastname, phone etc once the user has entered all theses details I have a textbox called status, the status should display as 'entered', which trigger should I use for this...?

[Updated on: Tue, 19 February 2019 22:02]

Report message to a moderator

Re: how to check if all the records in a form was filled by the user [message #674871 is a reply to message #674864] Wed, 20 February 2019 03:30 Go to previous messageGo to next message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
Are all those items in the same datablock?

If so shouldn't your original question be "How to check if all the items in a single record are filled in by the user?"

Which is completely different from what you asked.

Assuming that's what you meant - when-validate-item on all the items is the only way to do it.
I personally just would never bother having a status item like that - why do you think you need one?
Re: how to check if all the records in a form was filled by the user [message #674872 is a reply to message #674871] Wed, 20 February 2019 05:34 Go to previous messageGo to next message
minnu
Messages: 4
Registered: February 2019
Junior Member
I'm new to PL sql and forms hence I might have got the technical names wrong. My apologies.I need to use the status item. Yeah all the items are in the same datablock. Yeah a about validate items, the doubt i'm having is ,should I write when validate item for all items like name,lastname, address etc??

[Updated on: Wed, 20 February 2019 05:35]

Report message to a moderator

Re: how to check if all the records in a form was filled by the user [message #674873 is a reply to message #674872] Wed, 20 February 2019 05:52 Go to previous messageGo to next message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
If you don't know the difference between records and items (and datablocks for that matter) then you need to stop trying to code forms until you've learned the difference. The distinction matters a great deal.

If you really want this then you'll need a when-validate-item trigger on every item that the user has to fill in.
I suggest you write a procedure that checks all the items are not null and sets the status accordingly. Call the procedure from all the triggers.
Re: how to check if all the records in a form was filled by the user [message #674875 is a reply to message #674873] Wed, 20 February 2019 06:16 Go to previous messageGo to next message
minnu
Messages: 4
Registered: February 2019
Junior Member
I'll learn it, thank you for your help.
Re: how to check if all the records in a form was filled by the user [message #674908 is a reply to message #674875] Thu, 21 February 2019 09:32 Go to previous messageGo to next message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
Or you can set every item's Required property to YES.

Or be fancy and put a formula on your STATUS field that checks the count of null values for the columns in question. something like select sum(decode(:col1,null,1,0) + decode(...)) from dual;

[Updated on: Thu, 21 February 2019 09:36]

Report message to a moderator

Re: how to check if all the records in a form was filled by the user [message #674909 is a reply to message #674908] Thu, 21 February 2019 09:45 Go to previous messageGo to next message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
The fields should all be set to required but that won't have any affect on a status field.
Though personally I don't see the point of a status field. If you have required set and try to save forms will tell you what you haven't filled in.
If you want to use a forumla a CASE would be far simpler:
SELECT CASE WHEN :col1 IS NOT NULL
            AND :col2 IS NOT NULL
            AND :col3 IS NOT NULL
            ....
            THEN 'Entered'
            ELSE NULL
       END
FROM dual
Re: how to check if all the records in a form was filled by the user [message #674916 is a reply to message #674909] Thu, 21 February 2019 13:21 Go to previous message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
cookiemonster wrote on Thu, 21 February 2019 10:45
The fields should all be set to required but that won't have any affect on a status field.
Though personally I don't see the point of a status field. If you have required set and try to save forms will tell you what you haven't filled in.
If you want to use a forumla a CASE would be far simpler:
Good one Smile
Previous Topic: frm-92103 a network error or server failure has occurred (11 g)
Next Topic: FORMS INSTALL
Goto Forum:
  


Current Time: Thu Mar 28 20:59:13 CDT 2024