how to validate a record in oracle form? [message #202206] |
Wed, 08 November 2006 14:03 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
prashant_pathak
Messages: 263 Registered: February 2006 Location: California,US
|
Senior Member |
|
|
Hi ,
I have a form in which a block displaying 5 rows at a time.
The block display items is like
Routing_set_name,Alloy,Planner_code,Group_name,Percent,Routing_item.
I have to do a validation for any new or existing record with respect to percent column.
No routing_set_name should exceed 100%.
eg. valid data
Routing_set_name,Alloy,Planner_code,Group_name,Percent,Routing_item.
RS1 A1 P1 G1 100 RI1
so if any one trying to enter another RS1(routing_set_name) record form should throw an error as RS1 already has 100%.
How can i do this kind of validation in form?
Thanks in advance
Prashant Pathak
Mod-Upd: So it fits on one page.
[Updated on: Wed, 08 November 2006 18:18] by Moderator Report message to a moderator
|
|
|
Re: how to validate a record in oracle form? [message #202207 is a reply to message #202206] |
Wed, 08 November 2006 14:07 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
prashant_pathak
Messages: 263 Registered: February 2006 Location: California,US
|
Senior Member |
|
|
I have writtern KEY-NEXT-ITEM trigger on percent item calling program unit doing a validation as following but not working.
IF event_name = 'KEY-NEXT-ITEM' THEN
DECLARE
l_percent NUMBER :=0 ;
BEGIN
first_record;
LOOP
IF (:system.Last_record = 'TRUE') THEN
EXIT;
ELSE
message(:SMCBOM_ROUTING_MODELS.ROUTING_SET_NAME);
BEGIN
select nvl(SUM(percent),0)
into l_percent
from apps.smcbom_routing_models
where routing_set_name = :SMCBOM_ROUTING_MODELS.ROUTING_SET_NAME;
IF l_percent >= 100 THEN
message('Percent...'||'-'||to_char(l_percent));
ELSE
message('Percent...'||'-'||to_char(l_percent));
END IF;
EXCEPTION
WHEN NO_DATA_FOUND THEN
l_percent := 0;
WHEN OTHERS THEN
l_percent := 0;
END;
next_record;
END IF;
END LOOP;
EXCEPTION
WHEN OTHERS THEN
l_percent := 0;
END;
END IF;
any suggestion....
Thanks in advance
Thanks & Regards
Prashant Pathak
[Updated on: Wed, 08 November 2006 18:21] by Moderator Report message to a moderator
|
|
|
|
Re: how to validate a record in oracle form? [message #202235 is a reply to message #202234] |
Wed, 08 November 2006 18:46 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
prashant_pathak
Messages: 263 Registered: February 2006 Location: California,US
|
Senior Member |
|
|
Hi David,
I am using 4.5.
I am sorry i am really new to form so i might not understand what you are saying it will take some time get a grip.....
Is there any way only check for a perticular records.
Thanks in advance
Prashant Pathak
|
|
|
Re: how to validate a record in oracle form? [message #202236 is a reply to message #202234] |
Wed, 08 November 2006 18:56 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
prashant_pathak
Messages: 263 Registered: February 2006 Location: California,US
|
Senior Member |
|
|
Hi David,
The scenario is like ...
There will be 5 records in block displayed at time.
So a user wants add/update record using this form he can add/update any line on form.
so on-insert/on-update for a perticular routing_set_name i have to check that any combination not crossed 100.
Let me know if you any suggestion.
Thanks in advance
Prashant Pathak
|
|
|
|
Re: how to validate a record in oracle form? [message #202257 is a reply to message #202255] |
Wed, 08 November 2006 20:56 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
prashant_pathak
Messages: 263 Registered: February 2006 Location: California,US
|
Senior Member |
|
|
Hi David,
Thanks a lot for the reply.
Do you have a table that will store the accummulated 'Percent'?
>> NO
I hope you don't as, from a database design point of view, it is highly redundant.
>> Correct
We could 'commit' after each record and then do a 'select' on the database and add the current record's value to it and then do the test.
>> Can you please explain how can get total? i mean...on which trigger i can total.
Alternatively, build a 'record_group' with the 'Routing_set_name' and accumulated 'Percent' and use it in the When-Validate-Item trigger on the 'Percent' field.
>> I will read for record_group how to create that? will give you an update if i found some things.
Thanks a lot
Thanks & Regards
Prashant Pathak
|
|
|
|
|
|
Re: how to validate a record in oracle form? [message #202404 is a reply to message #202376] |
Thu, 09 November 2006 10:16 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
prashant_pathak
Messages: 263 Registered: February 2006 Location: California,US
|
Senior Member |
|
|
Hi David,
Can you please help in following?
I want to copy/duplicate some records in same block.
Block is have following column.
Routing Set Name , Alloy , Planner Code , Group , Percent and a copy Button.
When a copy button pressed take the current record's routing set name and duplicate all record in same block.
Eg.
Routing Set Name , Alloy , Planner Code , Group , Percent
R A P G 80
R A1 P G 20
When copy button pressed duplicate above two record in same block but do not insert into base table.
How to do that?
Thanks in advance
Prashant Pathak
|
|
|
Re: how to validate a record in oracle form? [message #202428 is a reply to message #202404] |
Thu, 09 November 2006 14:18 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
There's no need to code that; Oracle Forms already provide such a functionality.
Open a new, empty record below the one you'd like to duplicate. From the Record menu select "Duplicate Record" and that's it.
For list of shortcut keys press <Ctrl+K>.
|
|
|