Home » Developer & Programmer » Forms » What type of triiger needs to get fired when we want to default values in text item (10g)
What type of triiger needs to get fired when we want to default values in text item [message #653102] Mon, 27 June 2016 14:27 Go to next message
lucky123
Messages: 12
Registered: June 2016
Junior Member
I have a requirement to default first three values(rows) of a text item to three different values.Please suggest


[MERGED by LF]

[Updated on: Tue, 28 June 2016 01:05] by Moderator

Report message to a moderator

What type of triiger needs to get fired when we want to default values in text item [message #653103 is a reply to message #653102] Mon, 27 June 2016 14:56 Go to previous messageGo to next message
lucky123
Messages: 12
Registered: June 2016
Junior Member
What type of trigger needs to be used when an item should display with three different values in first three records.
Let say I created a text item with 5 records.First three records should get defaulted with three different values ad they should be readonly.From 4th records we should be able to enter and save data.Please suggest.


Re: What type of triiger needs to get fired when we want to default values in text item [message #653114 is a reply to message #653103] Tue, 28 June 2016 01:10 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
One option might be to create 3 global variables and populate each of them with a DBMS_RANDOM value. Then, by checking :SYSTEM.TRIGGER_RECORD value, use them where appropriate. Alternatively, use a LOOP to do the same job (without global variables).

Or, you could pre-populate that block (using INSERT INTO statement) and preforming query which would fetch 3 records and let you enter the rest.

Although, this is a somewhat strange requirement. What will you use that form for? It sounds like the recent question we've had here, How to control editing at particular record in Detail Block.
Re: What type of triiger needs to get fired when we want to default values in text item [message #653183 is a reply to message #653102] Tue, 28 June 2016 11:01 Go to previous message
lucky123
Messages: 12
Registered: June 2016
Junior Member
Hi Littlefoot,

Thanks for the reply.But can you please be more specific.I am new to forms.Please find the requirement details:

Created table with three columns.

Name char,code char,percentage number.

created multirecord block item on the detail form.

Name Code percent

record1 record1 record1
record2 record2 record2
record3 record3 record3
record4 record4 record4


When I open the form or click on the first records it should get prepolulated with values.only first record.The rest of the record values user will add.Please let me know in which trigger can I handle the code and how to populate the first record fdefault value.

Thanks
lucky




Previous Topic: What Type of Trigger Required For Automatically Fire Trigger when cursor on Text Field (merged 2)
Next Topic: how to make a field readonly before saving
Goto Forum:
  


Current Time: Thu Mar 28 16:42:27 CDT 2024