Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Run formula from a button

user626836Oct 3 2011 — edited Oct 3 2011
Hi everyone,
I have a form with 2 blocks. The first one is the master block and the second is the detail block. I use the first block to type the values that I want to search on my detail block. So when I display all the values on my detail block, the user has to make changes on it, like putting numeric values. After they finish typing they press a button where I have the formula which is the one to calculate a percent, but when we press the button only the row where I have the cursor is the one that gets calculate and not the rest.
Can anyone please help to create a code to calculate all the rows at the same time?
This is what I have on the trigger right now:
Begin
	If :BLOCK1.ITEM1 Between 0 and 100 and :BLOCK1.ITEM2 Between 0 and 100
		and :BLOCK1.ITEM3 Between 0 and 100 then
		:BLOCK1.ITEM4 := (:BLOCK1.ITEM1 * 0.40) + (:BLOCK1.ITEM2 * 0.40) + (:BLOCK1.ITEM3 * 0.20);
	Elsif
		:BLOCK1.ITEM1 Between 0 and 100 and :BLOCK1.ITEM2 Between 0 and 100 and :BLOCK1.ITEM3 is null then
		:BLOCK1.ITEM4 := (:BLOCK1.ITEM1 + :BLOCK1.ITEM2)/2;
	Elsif
			:BLOCK1.ITEM1 Between 0 and 100 and :BLOCK1.ITEM2 is null and :BLOCK1.ITEM3 Between 0 and 100 then
			:BLOCK1.ITEM4 := (:BLOCK1.ITEM1 + :BLOCK1.ITEM3);
	End if;
	
End;
[/CODE]

Thanks in advance                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 31 2011
Added on Oct 3 2011
5 comments
244 views