Armando_Rod2000
13th September 2002, 01:14
Hi!!!!
i have a maintain session and i trying to show in the main form some field from others tables. how i can do for refresh the data in the form depending main table's curr.occ. i´m triyng with refresh.curr.occ, display.all() and others but only refresh the main table data (main session´s table) and others field are blank. I´m trtying with integral reference but don´t refresh nothing.

must to prog. some querys at the script? ----> I did it but i dont know how refresh all te form....

Francesco
13th September 2002, 02:29
You have to include display commands for every field that you update.

In pseudo code it would be something like:

when.field.changes:
give field A a new value
display("A")
give field B a new value
display("B")

Hope this helps.

shah_bs
13th September 2002, 03:45
And remember to issue a refresh() command after the display. Sometimes, just the display("...") does not alone work.

Alternatively, you could program the field that you are displaying based on a change to the field of the main table as follows: in psuedocode:


field.to.be.displayed:
before.display:
select to.be.displayed
from ...
where tobedisplayedtable.index = :new.maintable.value


That way, you do not have to clutter up the program with display statements. Of course, this also has to be done for each field required to be displayed.

OmeLuuk
13th September 2002, 10:23
When you know why, then you don't forget.

Remember the Baan system is a Server oriented program. Although you run the sessions etc local, you run them on the client. Actually the sessions are not run locally, but they run under the (nt)bshell(6.x) process on the server. There a screen is kept (internally). This screen is copied to the server once in a while.

The display function put things on the internal screen of the bshell screen.
The refresh function pushes the internal screen to the client.

It is not done directly in one go, because now the session programmer can have more control over what the client sees. Inconsitency on screens can be avoided.

Armando_Rod2000
13th September 2002, 15:44
Thaks to all.
But i really want to know if exists a function or anything that i would use in BAAN for refresh all the fields in a form. I´m actually using 20 or more fields from diferents tables, i want to know how i can refresh all at a time.
I think that use when.field.change: bla, bla, bla display("field") for 20 or more fields not seem so good at a script code. There is a function that can do it in a single line (for example: display.all()).
If u have the explication, please let it know me!!!!!. Thakns!!!!!

mark_h
13th September 2002, 16:55
The way I did something like this was to use a subroutine. On the main table field that was the key to my other data I put in two sections:


field.tipgcxxx.field:
before.display:
get_other_fields()
when.field.changes:
get other fields()

functions get_other_fields()
{
select ....
endselect
display.all()
}


This way when they zoomed to some maintable record I looked up my other fields. If they changed the main table field then I did another look up. The difference is that I only add to lookup one additional field - not 20. Plus my field was only a display - not something that got updated. I have not had a problem with display.all().

Good Luck!

Mark

Mark

nick_rogers
16th September 2002, 15:44
you could also execute the choice refresh.data. This will display all the fields with their current value.

OmeLuuk
16th September 2002, 18:01
Nick_Rogers: ... This will display all the fields with their current value. current, previous committed!!! Note that intermediate changes are lost.