Home » Developer & Programmer » Forms » FRM-40737 what i can do .. ??
FRM-40737 what i can do .. ?? [message #442399] Sun, 07 February 2010 13:43 Go to next message
ahmed_samir
Messages: 61
Registered: January 2009
Location: EGYPT
Member
hi there

i want to use cursor to get data from db to "control block "(db item =no ) this data had where clause depend on item on other block

this my code :
declare 
	
cursor get_sol is
select SOL_STEP,PROB_ID
from MI_SOLUTION
where PROB_ID=:MI_FORM_PROB.PROB_ID;

begin 
	   go_block('control');
	   
	   open get_sol;
loop 	   
	   fetch get_sol into 	:CONTROL.txt_sol_step,	:CONTROL.TXT_BROB_ID;
	   next_record;
	   exit when get_sol%notfound;
end loop;
	    go_block('MI_FORM_PROB');
	   
   
end ;


when am using when_validate_item trigger error raise :
FRM-40737:Illegal restricted procedure next_record in when_validate_item


that's the trigger ???? or how to solve ??

in case of execute query in what trigger i will write the same code to get data in case of execute query by user ..
  • Attachment: err.GIF
    (Size: 13.08KB, Downloaded 199 times)
Re: FRM-40737 what i can do .. ?? [message #442401 is a reply to message #442399] Sun, 07 February 2010 15:21 Go to previous messageGo to next message
Littlefoot
Messages: 20827
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Don't do it in WHEN-VALIDATE-ITEM trigger. Read Forms Online Help system about "restricted procedures".

Quote:
in case of execute query in what trigger i will write the same code
Right there - in the KEY-EXEQRY trigger.
Re: FRM-40737 what i can do .. ?? [message #442402 is a reply to message #442399] Sun, 07 February 2010 15:38 Go to previous messageGo to next message
ahmed_samir
Messages: 61
Registered: January 2009
Location: EGYPT
Member
the problem that i know .. the restricted >> "" no navigation in post - pre - when ""

but i don't know the time for trigger fire ..

thanks
Re: FRM-40737 what i can do .. ?? [message #442403 is a reply to message #442399] Sun, 07 February 2010 15:58 Go to previous messageGo to next message
ahmed_samir
Messages: 61
Registered: January 2009
Location: EGYPT
Member
dear Littlefoot

thanks 4 your help ..

am try what u say .. and made trigger KEY-EXEQRY and write inside it the same good above .. but am trying to but this trigger in different levels ( form - block ) but the problem is error raise that

frm40202 field must be entered


what the idea .. ??

thanks 4 your . help
Re: FRM-40737 what i can do .. ?? [message #442422 is a reply to message #442403] Sun, 07 February 2010 23:28 Go to previous messageGo to next message
athar.fitfd@hotmail.com
Messages: 193
Registered: October 2007
Location: pakistan
Senior Member

You can do it using a button in that particular block. and write code in WHEN-BUTTON-PRESSED trigger of the button.

I think this will solve your problem.


Athar


Re: FRM-40737 what i can do .. ?? [message #442641 is a reply to message #442399] Tue, 09 February 2010 12:03 Go to previous messageGo to next message
ahmed_samir
Messages: 61
Registered: January 2009
Location: EGYPT
Member
dear .. athar.fitfd

i use button .. it's ok .. thanks ..

but when i try to execute query using execute key not work ( no data retrieve from database to the control block )

what's trigger .. ot how to solve

thanks
Re: FRM-40737 what i can do .. ?? [message #442653 is a reply to message #442641] Tue, 09 February 2010 14:18 Go to previous messageGo to next message
nastyjillu
Messages: 211
Registered: February 2009
Senior Member
ahmed,

is any field in your control block a required filed?

thanks
jillu
Re: FRM-40737 what i can do .. ?? [message #442661 is a reply to message #442399] Tue, 09 February 2010 15:40 Go to previous messageGo to next message
ahmed_samir
Messages: 61
Registered: January 2009
Location: EGYPT
Member
no ..

but the idea i but this code in key_execture trigger :
declare 
	
cursor get_sol is
select SOL_STEP,PROB_ID
from MI_SOLUTION
where PROB_ID=:MI_FORM_PROB.PROB_ID;

begin 
	   --go_block('control');
	   execute_query;
	   
	   open get_sol;
loop 	   
	   fetch get_sol into 	:CONTROL.txt_sol_step,	:CONTROL.TXT_BROB_ID;
	   next_record;
	   exit when get_sol%notfound;
end loop;
	    --go_block('MI_FORM_PROB');
	   
end ;


but the problem is the data shown in the first record in the control block only ... and the idea of next_record to worked

thank
Re: FRM-40737 what i can do .. ?? [message #442674 is a reply to message #442661] Tue, 09 February 2010 22:42 Go to previous messageGo to next message
tamzidulamin
Messages: 132
Registered: October 2009
Location: Dhaka
Senior Member
dear,

Quote:

Make Sure your Control Block is Multi Record Block
Change CONTROL block properties
"Number of Records Displayed"
value must be greater than 1


Try the following code:
(You must have knowledge about triggring scope,that means where you write your trigger).

Begin
       go_block('control'); 
       
       For i in (select SOL_STEP,PROB_ID
                from MI_SOLUTION
                where PROB_ID=:MI_FORM_PROB.PROB_ID)
       Loop         
       
        :CONTROL.txt_sol_step := i.SOL_STEP;    
        :CONTROL.TXT_BROB_ID  := i.PROB_ID ;
        
        next_record;
        
       End Loop; 
       
       
End ;


Regrads,
Tamzidul Amin.
Re: FRM-40737 what i can do .. ?? [message #443029 is a reply to message #442399] Fri, 12 February 2010 02:49 Go to previous message
ahmed_samir
Messages: 61
Registered: January 2009
Location: EGYPT
Member
dear tamzidulamin

thanks for your code it's work that's good ..but there two things want ::

1- do u have any paper or book to know the scopes of the triggers

2- i want to add data in the control block depend on each record in the data block mean that .. with the new record write in the control ..


thanks
Previous Topic: Convert form 6i to 10g
Next Topic: Dynamically value (get roles) in combo box
Goto Forum:
  


Current Time: Thu Sep 29 03:59:18 CDT 2016

Total time taken to generate the page: 0.06989 seconds