Home » Developer & Programmer » Forms » Passing values (merged 2)
Passing values (merged 2) [message #540623] Tue, 24 January 2012 17:47 Go to next message
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 #540630 is a reply to message #540623] Tue, 24 January 2012 18:42 Go to previous messageGo to next message
cookiemonster
Messages: 10929
Registered: September 2008
Location: Rainy Manchester
Senior Member
Well parameters shouldn't do that, so why don't you post the code you used?
Re: Passing values (merged 2) [message #540636 is a reply to message #540630] Wed, 25 January 2012 00:42 Go to previous messageGo to next message
Littlefoot
Messages: 19526
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
You probably modified one (or more) database items' values (not that you actually typed something in there - trigger(s) probably did that) and Forms think that something has changed and asks you whether you want to save those changes.

See whether any of options described here (setting record's status to QUERY_STATUS or item's ITEM_IS_VALID property to TRUE) helps.

By the way, I agree with Cookiemonster - I don't think that parameters are culprits.
Re: Passing values (merged 2) [message #542120 is a reply to message #540636] Sat, 04 February 2012 09:41 Go to previous messageGo to next message
eddyno
Messages: 20
Registered: January 2012
Location: Beograd
Junior Member
This is my when-new-form instance code:
:TROSKOVI_ODRZAVANJA.VRSTA_ODRZAVANJA := :PARAMETER.P_VRSTA_KVARA;
:TROSKOVI_ODRZAVANJA.RBR := :PARAMETER.P_RADNI_NALOG_BR;
:TROSKOVI_ODRZAVANJA.DATUM := :PARAMETER.P_DATUM;
:TROSKOVI_ODRZAVANJA.ID := :PARAMETER.P_ID;

Every time I open form Troskovi_odrzavanja and execute_query it asked do you want to save...? Those options above doesn't works in my case, doesn't recognise (<item> )
Re: Passing values (merged 2) [message #542125 is a reply to message #542120] Sat, 04 February 2012 11:21 Go to previous messageGo to next message
cookiemonster
Messages: 10929
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 Go to previous messageGo to next message
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 #542140 is a reply to message #542133] Sun, 05 February 2012 04:35 Go to previous messageGo to next message
cookiemonster
Messages: 10929
Registered: September 2008
Location: Rainy Manchester
Senior Member
What do you expect to do with the parameters in the 2nd form?
Are you using them to restrict the query?
Re: Passing values (merged 2) [message #542301 is a reply to message #542140] Mon, 06 February 2012 08:40 Go to previous messageGo to next message
eddyno
Messages: 20
Registered: January 2012
Location: Beograd
Junior Member
Not exactly to restrict just trying to pass some of values from first form and give that values to parameters
Re: Passing values (merged 2) [message #542309 is a reply to message #542301] Mon, 06 February 2012 09:14 Go to previous messageGo to next message
cookiemonster
Messages: 10929
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 #542486 is a reply to message #542309] Tue, 07 February 2012 08:26 Go to previous messageGo to next message
eddyno
Messages: 20
Registered: January 2012
Location: Beograd
Junior Member
I am trying to pass a values a have in first code:
:TROSKOVI_ODRZAVANJA.VRSTA_ODRZAVANJA := :PARAMETER.P_VRSTA_KVARA;
:TROSKOVI_ODRZAVANJA.RBR := :PARAMETER.P_RADNI_NALOG_BR;
:TROSKOVI_ODRZAVANJA.DATUM := :PARAMETER.P_DATUM;
:TROSKOVI_ODRZAVANJA.ID := :PARAMETER.P_ID;

to parameters p_vrsta_kvara, p_radni_nalog, p_datum, p_id, so they are automaticly passed into troskovi_odrzavanja form, values
vrsta_odrzavanja, rbr, datum, id.




Re: Passing values (merged 2) [message #542487 is a reply to message #542486] Tue, 07 February 2012 08:29 Go to previous messageGo to next message
cookiemonster
Messages: 10929
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 #542491 is a reply to message #542486] Tue, 07 February 2012 08:33 Go to previous messageGo to next message
eddyno
Messages: 20
Registered: January 2012
Location: Beograd
Junior Member
I delete WNFI trigger, so any other way(trigger) i can use to pass values from first "radni_nalog",form to another troskovi_Odrzavanja???
Re: Passing values (merged 2) [message #542494 is a reply to message #542491] Tue, 07 February 2012 08:38 Go to previous messageGo to next message
cookiemonster
Messages: 10929
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 #542499 is a reply to message #542494] Tue, 07 February 2012 09:49 Go to previous messageGo to next message
eddyno
Messages: 20
Registered: January 2012
Location: Beograd
Junior Member
In the second form i use them(parameters) for accepting and display some values from first form i gave them where i created parameters in wbpt. I said that i think??

[Updated on: Tue, 07 February 2012 09:52]

Report message to a moderator

Re: Passing values (merged 2) [message #542500 is a reply to message #542499] Tue, 07 February 2012 09:57 Go to previous messageGo to next message
cookiemonster
Messages: 10929
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 Go to previous messageGo to next message
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 #544964 is a reply to message #542891] Sat, 25 February 2012 10:25 Go to previous messageGo to next message
eddyno
Messages: 20
Registered: January 2012
Location: Beograd
Junior Member
So i'm waiting for an answer, how to avoid passing variable throw paramaters and globals, or how to avoid giving values to parameters in second form with WNFI trigger?? WNFI trigger is:
:TROSKOVI_ODRZAVANJA.VRSTA_ODRZAVANJA := :PARAMETER.P_VRSTA_KVARA;
:TROSKOVI_ODRZAVANJA.RBR := :PARAMETER.P_RADNI_NALOG_BR;
:TROSKOVI_ODRZAVANJA.DATUM := :PARAMETER.P_DATUM;
:TROSKOVI_ODRZAVANJA.ID := :PARAMETER.P_ID;

Any other trigger insted WNFI, that can be used would be helpfull also. And in where property of the Troskovi_Odrzavanja block i gave those values to parameter like in trigger above except := i put (=), but i doesn't display query results??
Re: Passing values (merged 2) [message #544979 is a reply to message #544964] Sat, 25 February 2012 17:39 Go to previous message
cookiemonster
Messages: 10929
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.
Previous Topic: D2KWUTIL in Windows 7
Next Topic: Double insertion!
Goto Forum:
  


Current Time: Sat Aug 30 21:58:34 CDT 2014

Total time taken to generate the page: 0.07446 seconds