Home » Developer & Programmer » Application Express, ORDS & MOD_PLSQL » A bit of form help (Application Express, 4.0, windows 7)
A bit of form help [message #533465] Wed, 30 November 2011 03:09 Go to next message
abarnybox
Messages: 49
Registered: November 2011
Member
Hi,

I have a few questions on forms that I can't find on the internet or on the APEX help thing.
Firstly, how do you automatically retrieve an ID from the database and put it in another form. e.g. I fill in my personal details on one form then I want to make a complaint, I would like a PERSON_ID on the COMPLIANT form to be automatically input then I can have it hidden.

Secondly, I don't know if its possible and its not overly important, but I would like a form to be automatically filled out based on the first field if its already been input before. e.g. I go back next day to make a request and it asks me to fill my details out again, if I enter my User ID I would like it to fill out the form automatically based on that.

and then finally, If the cancel button is pressed on the confirmation page I would like it to delete the request from the database. This seems like it should be relatively simple to do...like entering records, but I can't figure it out (I am new to APEX).

Thanks in advance for your help
abarnybox
Re: A bit of form help [message #533493 is a reply to message #533465] Wed, 30 November 2011 04:35 Go to previous messageGo to next message
abarnybox
Messages: 49
Registered: November 2011
Member
OK I got the first one using an advanced dynamic action...don't know if thats how it should be done really, but it seems to be working.

The second i've decided against doing in the end

just the third I need help on now really thanks
Re: A bit of form help [message #533498 is a reply to message #533493] Wed, 30 November 2011 04:52 Go to previous messageGo to next message
c_stenersen
Messages: 255
Registered: August 2007
Senior Member
Just create an on-submit process which does the delete, and has as a condition that the cancel button was pressed
Re: A bit of form help [message #533500 is a reply to message #533498] Wed, 30 November 2011 05:04 Go to previous messageGo to next message
abarnybox
Messages: 49
Registered: November 2011
Member
What kind of proces should I use? Data Manipulation?
Re: A bit of form help [message #533501 is a reply to message #533500] Wed, 30 November 2011 05:08 Go to previous messageGo to next message
c_stenersen
Messages: 255
Registered: August 2007
Senior Member
I would just use PL/SQL and write the delete command in regular sql using your page item(s) holding the primary key in the where clause.
Re: A bit of form help [message #533522 is a reply to message #533501] Wed, 30 November 2011 06:49 Go to previous messageGo to next message
abarnybox
Messages: 49
Registered: November 2011
Member
Ok thanks I got it,

just one little question, in an SQL statement how do you select an item value. Like if I want to select the value the item currently holds? is it like &ITEM_ID.? or something like that?
Re: A bit of form help [message #533523 is a reply to message #533522] Wed, 30 November 2011 07:22 Go to previous messageGo to next message
c_stenersen
Messages: 255
Registered: August 2007
Senior Member
Use :ITEM_ID
Re: A bit of form help [message #533525 is a reply to message #533523] Wed, 30 November 2011 07:35 Go to previous messageGo to next message
abarnybox
Messages: 49
Registered: November 2011
Member
hmm it doesn't seem to be working
SELECT DISTINCT "FIRSTNAME" FROM "FM_PERSON" WHERE "USER_ID" = ':P15_USER_ID'

I tried it with &APP_USER. just to make sure it was ok and it worked fine...but with that it doesn't
Re: A bit of form help [message #533540 is a reply to message #533525] Wed, 30 November 2011 08:22 Go to previous message
c_stenersen
Messages: 255
Registered: August 2007
Senior Member
Remove the quotes around :P15_USER_ID. You can use :P15_USER_ID in the same way as any other variable.
Previous Topic: Form Error
Next Topic: pass more than one value from one page to another
Goto Forum:
  


Current Time: Thu Mar 28 11:40:35 CDT 2024