Home » Developer & Programmer » Forms » Conditionally limit detail records in master-detail form (Oracle Forms 10g, 10.1.2.3, Linux)
Conditionally limit detail records in master-detail form [message #432689] Wed, 25 November 2009 13:44 Go to next message
dlwixon
Messages: 92
Registered: September 2008
Member

I have a master detail form that shows one master record and initially 10 detail records. The user can add more than 10 if they want. There is a relation on the master block that connects the two blocks.

Is there a way to conditionally limit the number of detail records are displayed and allowed if a certain value is entered into a control block field?


icon14.gif  Re: Conditionally limit detail records in master-detail form [message #432690 is a reply to message #432689] Wed, 25 November 2009 14:36 Go to previous messageGo to next message
infosuresh2k
Messages: 77
Registered: September 2009
Location: CHENNAI, INDIA
Member

yes you can do this using forms default where clause

set_block_property('detail_block', default_where, 'detail_block.id = '||:master_block.id||'AND ROWNUM <='||:CTRL_BLK.RECORD);
go_block('DETAIL_BLOCK');
EXECUTE_QUERY;

* :CTRL_BLK.RECORD u can enter 10 or 20 etc.,

Regards,
Suresh V
Re: Conditionally limit detail records in master-detail form [message #432693 is a reply to message #432690] Wed, 25 November 2009 15:03 Go to previous messageGo to next message
dlwixon
Messages: 92
Registered: September 2008
Member
Thanks.

But I don't want to enter a query in the blocks.

The form is for data entry. So I want to limit (in some instances) how much a user can enter into the detail section.
Re: Conditionally limit detail records in master-detail form [message #432695 is a reply to message #432693] Wed, 25 November 2009 15:14 Go to previous messageGo to next message
infosuresh2k
Messages: 77
Registered: September 2009
Location: CHENNAI, INDIA
Member

Set block level 'Maximum Records Fetched Property' to 10 or 20 ...

or

set_block_property('detail_block', MAX_RECORDS_FETCHED, :ctrl_blk.record_num);

Regards,
Suresh V

[Updated on: Wed, 25 November 2009 15:18]

Report message to a moderator

Re: Conditionally limit detail records in master-detail form [message #432696 is a reply to message #432695] Wed, 25 November 2009 15:38 Go to previous messageGo to next message
dlwixon
Messages: 92
Registered: September 2008
Member
Thanks for trying to help me here but MAX_RECORDS_FETCHED only specifies the max records that the block can retrieve after executing a query.

I want to limit the max number of rows available for data entry in the detail block depending on what is entered in the control block field.

So the user would come into the form and enter a value into the control block field. After entering a value for this field, the master block is available for data entry as well as the detail block. However, the number of rows the user can see in the detail and the the number of records the user can enter in the detail block will depend on the value that has been entered into the control block field.

It's this last part that I'm having a problem finding a solution for.

The default number of rows displayed in the detail block is 10. If they enter a certain value in the control block field, I want to limit them to 5 rows. So they would only be able to enter 5 records of data into the detail section.



[Updated on: Wed, 25 November 2009 15:40]

Report message to a moderator

Re: Conditionally limit detail records in master-detail form [message #435994 is a reply to message #432696] Sun, 20 December 2009 22:45 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Have you solved your problem?

Use 'get_block_property(current_record)' to get the current record number and if this number matches the 'control' value then stop the user from performing a 'down' command.

David
Previous Topic: Spread Table in Forms 6i
Next Topic: Problem in reading data from excel using oracle forms through oracle apps serever
Goto Forum:
  


Current Time: Tue Sep 27 11:06:31 CDT 2016

Total time taken to generate the page: 0.06794 seconds