Home » Developer & Programmer » Forms » Help me on code
Help me on code [message #602339] Tue, 03 December 2013 04:30 Go to next message
mist598
Messages: 1195
Registered: February 2013
Location: Hyderabad
Senior Member
Hi all,

I have 1 DB Block having 5 items and put the 5 items in CONTROL Block , put the all Control Blocks item On Canvas & create LOV's for all items .
1 find button
Lov's are created from d/f tables , not based on Block Table
and also Block table having all columns of all lov's
I want to display records from the Data Base only when i click on the FIND Button

Thank you
Re: Help me on code [message #602341 is a reply to message #602339] Tue, 03 December 2013 04:33 Go to previous messageGo to next message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I'm not sure I understood what you have, but it smells like the FIND button should modify data block's DEFAULT_WHERE (or ONETIME_WHERE) property (use SET_BLOCK_PROPERTY to do that) and set it to a combination of control block's items.
Re: Help me on code [message #602346 is a reply to message #602341] Tue, 03 December 2013 04:39 Go to previous message
mist598
Messages: 1195
Registered: February 2013
Location: Hyderabad
Senior Member
Hi Littlefoot,

Want to get the data from the Data Base please see the below code , if there any modification please let me know
FORECASTCONTROL(non-database),BLOCKNAME(database block) , having 5 items on both but i put the items in the canvas where in the control block

DECLARE
	FINALSTR VARCHAR2(1000);
	DFINALSTR VARCHAR2(1000);
BEGIN
	IF :FORECASTCONTROL.ORGANIZATION_CODE IS NOT NULL THEN 
		GO_BLOCK('BLOCKNAME');
	dfinalstr := GET_BLOCK_PROPERTY('BLOCKNAME',DEFAULT_WHERE);
		finalstr := 'where ORGANIZATION_CODE = '||(':FORECASTCONTROL.ORGANIZATION_CODE');
		SET_BLOCK_PROPERTY('BLOCKNAME',DEFAULT_WHERE,finalstr);
		execute_query();
	END IF;
	
		IF :FORECASTCONTROL.FISCAL_YEAR IS NOT NULL THEN 
		GO_BLOCK('BLOCKNAME');
	dfinalstr := GET_BLOCK_PROPERTY('BLOCKNAME',DEFAULT_WHERE);
		finalstr := 'where FISCAL_YEAR = '||(':FORECASTCONTROL.FISCAL_YEAR');
		SET_BLOCK_PROPERTY('BLOCKNAME',DEFAULT_WHERE,finalstr);
		set_block_property('BLOCKNAME', default_where, finalstr);
		execute_query();
	END IF;
END;
Previous Topic: serial number column forms level
Next Topic: Code review tool for forms 6i
Goto Forum:
  


Current Time: Thu Apr 25 17:11:15 CDT 2024