Passing values (merged 2) [message #540623] |
Tue, 24 January 2012 17:47 |
|
eddyno
Messages: 20 Registered: January 2012 Location: Beograd
|
Junior Member |
|
|
Hello, I've been searching for days a solution for a next problem. Problem is how to pass a values from one to another, but without using parameters or globals. I've used parameters and every time i have to list the values of the form that values have been passed to, it ask do you want to save... even if I didn't passed any values. It's because my code in where-new-form instance, where i give values to a parameters. Any solution how to solve that will be very helpfull??
|
|
|
|
|
|
Re: Passing values (merged 2) [message #542125 is a reply to message #542120] |
Sat, 04 February 2012 11:21 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
If you change a datablock database item then oracle forms assumes that that change needs to be applied to the database. So of course it must ask if you want to save changes.
The question is why is that code in the when-new-form-instance? what are you trying to do with it?
|
|
|
Re: Passing values (merged 2) [message #542133 is a reply to message #542125] |
Sat, 04 February 2012 17:16 |
|
eddyno
Messages: 20 Registered: January 2012 Location: Beograd
|
Junior Member |
|
|
With when-new-form-instance i'm simply trying to pass a values from one form called radni_nalog to a form evidencije_troskova, table troskovi_odrzavanja for example. In radni_nalog i have a button with code:
DECLARE
pl PARAMLIST:=GET_PARAMETER_LIST('PL_EDIT_EMP');
BEGIN
pl:=CREATE_PARAMETER_LIST('PL_EDIT_EMP');
ADD_PARAMETER(pl, 'P_MODE', TEXT_PARAMETER, 'EDIT');
ADD_PARAMETER(pl, 'P_RADNI_NALOG_BR', TEXT_PARAMETER, :RADNI_NALOG.RADNI_NALOG_BR);
ADD_PARAMETER(pl, 'P_VRSTA_KVARA',TEXT_PARAMETER, :RADNI_NALOG.VRSTA_KVARA);
ADD_PARAMETER(pl, 'P_DATUM',TEXT_PARAMETER, :RADNI_NALOG.DATUM);
ADD_PARAMETER(pl, 'P_TIP_VOZILA', TEXT_PARAMETER, :RADNI_NALOG.TIP_VOZILA);
ADD_PARAMETER(pl, 'P_VOZILO', TEXT_PARAMETER, :RADNI_NALOG.TIP_VOZILA);
add_parameter(pl, 'P_ID', text_parameter, :radni_nalog.id_vozila);
CALL_FORM('evidencije_troskova',NO_HIDE,DO_REPLACE,NO_QUERY_ONLY,pl);
END;
But a assume it doesn't have to be a when-new-from-instance, a tried post-query same problem happens when i execute_query in evidencije_troskova table , it ask do you want to save...? I tried to put this same code in where property of block troskovi_odrzavanja but execute_query doesn't work. I'm really a bit confused so...
|
|
|
|
|
Re: Passing values (merged 2) [message #542309 is a reply to message #542301] |
Mon, 06 February 2012 09:14 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
The problem here is nothing to do with parameters really. The problem is that you are trying to change the value of datablock items in the WNFI trigger and so oracle assumes those changes need to be applied to the DB.
You need to stop doing that.
We can not tell you what to do instead unless you tell us what you want to do with those values.
|
|
|
|
Re: Passing values (merged 2) [message #542487 is a reply to message #542486] |
Tue, 07 February 2012 08:29 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
The parameters are passed into the form. It's how you are using them in the WNFI trigger that is the problem.
Why are you trying to assign the parameters to datablock items in the WNFI trigger?
What are you trying to achieve by doing so?
|
|
|
|
Re: Passing values (merged 2) [message #542494 is a reply to message #542491] |
Tue, 07 February 2012 08:38 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
The values are passed. They're in the parameter block of the second form aren't they? That means they're passed.
The question I keep asking, which you keep failing to answer, is what do you want to use them for in the second form?
If you don't answer that question, no one can help you.
EDIT: typo
[Updated on: Tue, 07 February 2012 08:38] Report message to a moderator
|
|
|
|
Re: Passing values (merged 2) [message #542500 is a reply to message #542499] |
Tue, 07 February 2012 09:57 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Repeatedly, and it doesn't answer the question.
All that tells us is that you want to pass parameters between 2 forms. We know that.
What do you want to use the parameters for in the 2nd form?
What effect do you want them to have on the functionality of the 2nd form?
From a users point of view what do you expect them to do?
To put it yet another way - what do you want to do with them after the 2nd form has accepted them?
|
|
|
Re: Passing values (merged 2) [message #542891 is a reply to message #542500] |
Fri, 10 February 2012 12:26 |
|
eddyno
Messages: 20 Registered: January 2012 Location: Beograd
|
Junior Member |
|
|
I want them to be passed and saved in my second form, a did that with commit form, and use them for further calculation, for expample summiraze troskovi in same second form sorry i didn't understand question.
U drugoj formi u koju prenosim vrijednosti promenljivih, zeleo bih da imam prenesene promenljive sacuvane bez pitanja da li zelim da ih snimim, to sam uradio sa commit form, na kraju koda. A sa promenljivama koje prenesem poslije zelim da ih sabiram, na primer cijene troskova(ukupne troskove). Izvinjavam se jer nisam razumio pitanje odmah zbog mog engleskog jezika.
[Updated on: Fri, 10 February 2012 12:38] Report message to a moderator
|
|
|
|
Re: Passing values (merged 2) [message #544979 is a reply to message #544964] |
Sat, 25 February 2012 17:39 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
As I keep telling you, you pass values between forms as parameters. There is nothing wrong with that.
If the value of a database datablock item is changed in any way then oracle notes that it is changed and will ask if you want to save changes whenever you do anything that would cause the current data to be lost - like execute query.
You are changing the value of 4 database datablock items in the WNFI trigger. The fact that the values are coming from parameters is completely irrelevant.
As for why setting the where clause doesn't work - I suggest you make use of get_block_property(<block name>, last_query) to find out exactly what query is being issued to the DB.
|
|
|