Home » Developer & Programmer » Forms » How to control editing at particular record in Detail Block (Oracle Forms 10G)
How to control editing at particular record in Detail Block [message #652778] Sun, 19 June 2016 07:01 Go to next message
malya
Messages: 22
Registered: August 2015
Location: Hyderabad, India
Junior Member
Seems to be silly issue but unable to control the editing in detail block based on number of records. Form displays employee records in detail block based on a query written in When New Form Instance.

Example

Say, it populated 3 records at time of opening the form.
User should not edit these 3 records means any of the field of particular record in detail block though he can add 4th one and so on.

I tried the below code in When New Record Instance of details block
IF No_of_records(i.e. 3) > :SYSTEM.CURSOR_RECORD THEN 
SET_BLOCK_PROPERTY('BLOCKNAME',INSERT_ALLOWED,PROPERTY_TRUE);
SET_BLOCK_PROPERTY('BLOCKNAME',UPDATE_ALLOWED,PROPERTY_TRUE);
ELSE
SET_BLOCK_PROPERTY('BLOCKNAME',INSERT_ALLOWED,PROPERTY_FALSE);
SET_BLOCK_PROPERTY('BLOCKNAME',UPDATE_ALLOWED,PROPERTY_FALSE);
END IF

But this code is not allowing me to move to 4th record in detail block. I want to add 4th record. Please help with above code or any other alternatives are invited.

Thanks in advance.
Re: How to control editing at particular record in Detail Block [message #652780 is a reply to message #652778] Sun, 19 June 2016 07:30 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I'd say that you have to disable only UPDATE, not INSERT. Because - how do you plan to create a new record, if INSERT is disabled?
Re: How to control editing at particular record in Detail Block [message #652787 is a reply to message #652780] Mon, 20 June 2016 01:10 Go to previous messageGo to next message
malya
Messages: 22
Registered: August 2015
Location: Hyderabad, India
Junior Member
Hi Littlefoot,

Thanks for your reply. I tried with Update only, but it is allowing updating the existing field. I can type into the fields.
Not sure, where the mistake is occurring from my side.
Re: How to control editing at particular record in Detail Block [message #652799 is a reply to message #652787] Mon, 20 June 2016 03:07 Go to previous message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
Why are you using any code at all. Why not simply set update_allowed to No in the block property palette and leave it alone?
What difference does the number of records make?
Previous Topic: frm 40202 field must be entered error oracle
Next Topic: frm-40105 unable to resolve reference
Goto Forum:
  


Current Time: Thu Mar 28 17:29:13 CDT 2024