Home » Developer & Programmer » Forms » when_new_form_instance (merged 2) (oracle 10g forms)
when_new_form_instance (merged 2) [message #547819] Sat, 17 March 2012 01:18 Go to next message
furqan
Messages: 115
Registered: January 2012
Location: Hyderabad
Senior Member
hi..

i want to display records from a table in tabular form with
one condition.

i made a tabular form.and in WHEN-NEW-FORM-INSTANCE i write


DECLARE
CURSOR hascr IS
SELECT
BILL_ID,
BILL_DATE,
MAT_CODE,
PLACE_FROM,
PLACE_TO,
SEND_QTY,
TC_NO,
TRANSACT_NOTE,
BILL_TYPE
FROM SHIP_DTL WHERE BILL_TYPE='Send To Other Store';

BEGIN
OPEN hascr;
FETCh hascr INTO :SHIP_DTL.BILL_ID,
:SHIP_DTL.BILL_DATE,
:SHIP_DTL.MAT_CODE,
:SHIP_DTL.PLACE_FROM,
:SHIP_DTL.PLACE_TO,
:SHIP_DTL.SEND_QTY,
:SHIP_DTL.TC_NO,
:SHIP_DTL.TRANSACT_NOTE,
:SHIP_DTL.BILL_TYPE;

CLOSE hascr;

END;

when i run the form its not showing any errors but displaying only one record.
that is the first record whose bill_type is send to other store.

am i using the right trigger or my select statement has problem.??

please suggest ......
Re: when_new_form_instance [message #547825 is a reply to message #547819] Sat, 17 March 2012 01:40 Go to previous messageGo to next message
ranamirfan
Messages: 529
Registered: January 2006
Location: Pakistan / Saudi Arabia
Senior Member

Why you did not Use Form Built-in Execute Query ?
Re: when_new_form_instance [message #547843 is a reply to message #547825] Sat, 17 March 2012 03:24 Go to previous messageGo to next message
furqan
Messages: 115
Registered: January 2012
Location: Hyderabad
Senior Member
if i use execute query it will display all the record in the table. but i hav a condition where clause...

where bill_type='send to other store'

please help
Re: when_new_form_instance [message #547844 is a reply to message #547843] Sat, 17 March 2012 03:28 Go to previous messageGo to next message
ranamirfan
Messages: 529
Registered: January 2006
Location: Pakistan / Saudi Arabia
Senior Member

Press Enter Query Button & put value to bill_type column 'send to other store' after that press Execute Query button you'll get required record.
Re: when_new_form_instance [message #547845 is a reply to message #547844] Sat, 17 March 2012 03:37 Go to previous messageGo to next message
furqan
Messages: 115
Registered: January 2012
Location: Hyderabad
Senior Member
mr imran sir...


what i want is...

iam navigating to this form thru WHEN-BUTTON-PRESS trigger.

when we are pressing the button and calling this form,
i want all the records with bill_type SEND TO OTHER STORE must
get displayed.
Re: when_new_form_instance [message #547847 is a reply to message #547845] Sat, 17 March 2012 03:48 Go to previous messageGo to next message
ranamirfan
Messages: 529
Registered: January 2006
Location: Pakistan / Saudi Arabia
Senior Member

Quote:

When we are pressing the button and calling this form,
I want all the records with bill_type SEND TO OTHER STORE must
get displayed.


Go to Forms Data Blocks property there you'll have Database WHERE clause put this.This code 'll show only this type of bills.
bill_type='SEND TO OTHER STORE'


WHEN-NEW-FORM-INSTANCE
Execute_Query;


Regards,
Irfan
Re: when_new_form_instance [message #547848 is a reply to message #547847] Sat, 17 March 2012 04:00 Go to previous messageGo to next message
furqan
Messages: 115
Registered: January 2012
Location: Hyderabad
Senior Member
thank you very much sir...

i got the records displayed.

really thanx a lot.

just a small question if i want to display record of

bill type 1.send to other store 2.send to repair.

can i put both bill types in where clause ??

like...bill_type='send to other store','send to repair'


really thanks a lot...
Re: when_new_form_instance [message #547849 is a reply to message #547848] Sat, 17 March 2012 04:04 Go to previous messageGo to next message
ranamirfan
Messages: 529
Registered: January 2006
Location: Pakistan / Saudi Arabia
Senior Member

Yes.
Bill_type in ('SEND TO OTHER STORE','SEND TO REPAIR')


Regards,
Irfan
Re: when_new_form_instance [message #547852 is a reply to message #547849] Sat, 17 March 2012 04:49 Go to previous messageGo to next message
furqan
Messages: 115
Registered: January 2012
Location: Hyderabad
Senior Member
Thanks a lot imran sir...

i really appreciate your patience with me.
thanks a lot.

Regards
furqan
Re: when_new_form_instance [message #547853 is a reply to message #547852] Sat, 17 March 2012 05:20 Go to previous message
ranamirfan
Messages: 529
Registered: January 2006
Location: Pakistan / Saudi Arabia
Senior Member

Thanks for the feedback.

Regards,
Irfan
Previous Topic: Data source for fields in a form
Next Topic: How to use same collection on two forms
Goto Forum:
  


Current Time: Wed Nov 26 07:46:51 CST 2014

Total time taken to generate the page: 0.24756 seconds