baan_afbs
8th November 2002, 19:21
I have a custom display session which basically shows item data. This data needs to be in sync with the Maintain Item data. how can i have the screen automatically refresh without having the user choose the 'refresh' option? Can it refresh every 10 seconds automatically? i can use the function werebuild(1) or refresh.curr.occur().....but how can i trigger this function without the user even touching the keyboard or mouse??

thanks!!!

NPRao
8th November 2002, 20:26
You can refer to the post on the Board and Gordon's solution -

Continuous display of Baan information (http://www.baanboard.com/baanboard/showthread.php?s=&threadid=5419&highlight=while1)


last.time = time.num()
while true
curr.time = time.num()
if curr.time >= last.time + 10 then
|* Refreshes ever 10 seconds
execute(first.set)
last.time = curr.time
endif
endwhile

baan_afbs
9th November 2002, 00:54
Rao,
the soultion refreshes the screen but the program continues on into infinity. it will work if i use the code in the right program section....currently it is in the form.1/before.form section. (i have a single occurance display form. )

help!

NPRao
9th November 2002, 01:08
The quick idea I can think about it is to use a progress indicator with a stop button. When the user clicks the stop button the process is aborted

create.progress.indicator() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_progress_indicators_create_progress_indicator)


e =create.progress.indicator("Processing Data ", PROGRESS.BAR + PROGRESS.STOP)
......
if change.progress.indicator(perc,"Data") then
stop.refresh.process()
|* the function call to get the latest data
break
endif
.....
destroy.progress.indicator()

Ilansu
10th November 2002, 14:27
You can use the timer function .

before.program:
ret=set.timer(num.of.seconds *1000)

choice.interrupt:
on.choice:
execute(first.set) or (find.data)

set timer usage (http://www.baanboard.com/programmers_manual_baanerp_help_functions_timers_set_timer)

Ilan S

Grace Li
10th November 2002, 18:29
Did you try the set.timer() function? There is example given in the reference manual. You can put in expire condition.

albertsmid
18th May 2017, 18:50
Thanks for all the contributions, the set.timer() with the choice.interupt trigger worked great!

martin.f
11th March 2021, 14:37
Hello,
I want to display a session on a monitor with refresh every 1 minute.

The solution above with

before.program:
ret=set.timer(num.of.seconds *1000)

choice.interrupt:
on.choice:
execute(first.set) or (find.data

does execute find.data every minute.
However to see the result I have to click somewhere or scroll the window.
Is there any possibility to update ui automatically?

Regards
Martin

NPRao
11th March 2021, 20:47
Martin,

You can explore more with other options -

refresh.all.occs() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_form_and_form_field_operations_refresh_all_occs)

Process Change Manager overview (http://www.baanboard.com/programmers_manual_baanerp_help_functions_prcm_overview)

martin.f
12th March 2021, 08:51
Unfortunately, refresh.all.occs() does not refresh the ui.
I still have to click somewhere or scroll to see the changes.

Any other idea? I want to display session warehousing orders whinh2100m000 on a screen. Always when a new order is created it should get displayed automatically without user interaction.

Regards
Martin

mark_h
12th March 2021, 16:57
I seem to recall having this issue with a session in 4c4, so not sure it is relevant to LN. But if I recall correctly I did an execute after I had updated all the records, but could not get the screen to refresh. What I have not been able to do is find the session - I can't remember if I did like execute(first.set) or just execute(find.data). I am wondering if instead of clicking or scrolling you can try the same type thing in LN?

martin.f
12th March 2021, 17:38
I have already tried execute(find.data) and execute(first.set).
No automatic refresh happens..

mark_h
12th March 2021, 20:30
Wondering what if you just display one field followed by a refresh? Does that one specific field get displayed?

Like:
display("some.field")
refresh()

martin.f
15th March 2021, 08:32
Hi Mark,
no it does not work.
Have you any other ideas how I can set up an auto refresh for sessions?

mark_h
15th March 2021, 15:01
No - sorry I do not. I have always had the display field to work, or in the case of where I went off and updated the actual table, an actual find of the records again would work. I just don't know enough on how LN works or these time events.

andreas.toepper
16th March 2021, 09:33
Is your own session a subsession of the item data session? If you can modify both sessions it may be possible to add message bases refresh function to the subsession.

This is done using the prcm functions.

It works like this: the master session will send a refresh message and in the subsession you will have to react on this message.

I will give an easy example I use. I've taken the basic code from the example in the reference guide and modified it.
I have a table tseqs200. If a dataset is changed, the DAL will send a change message to the subsessions.

This is done by a simple call of function prcm.notify("tseqs200") in the DAL of tseqs200 in hook before.save.object().

In the subsession I added the following code, to react on the message:


before.program:
|Listen on messages from table:
prcm.register("tseqs200")

choice.bms:
on.choice:
if prcm.bms.is.notification() then
on case prcm.get.subject()
case "tseqs200": |* An update is done on table tseqs200
|* Refresh all data on the screen
refresh.all.occs()
break
endcase
endif


This is explaned in the reference guide in "Process Change Manager Code Examples" (check the pcrm functions; pcrm.notify will have a link to the example code).

vahdani
16th March 2021, 13:49
The probem is that alle the solutions mentioned (timer or prcm.notification) work fine if you still use the now "outdated" GUI user interface. If on the other hand you use the web based LN UI as we are all now supposed to do, then I can confirm that none of these solutions work and as mentioned by Martin you have to click sowehere on the screen to force a refresh!!

So we have to put the question to any Infor insiders who read this: Do you know about this in my opinion very disturbing problem? Do you have any solution that you can tell us about?

andreas.toepper
16th March 2021, 15:47
Well, I just can tell, that prcm.notification works on our soon to be live system (LN 10.7; LNUI on Google Chrome).
The code I quoted has been used in the WEBUI of our LN 10.2 live system (Internet Explorer). I remember adding the code, because some key user asked to see entered data in another session without refreshing the screen. (It's working in Worktop, too. I've checked it right now.)

This may depend on some setup details, i.e. the sub session which is listening to the prcm message is linked as a synchronized dialog.
I did some testing in LN 10.7 (LNUI) and deactivated the bms code in the synchronised child. It then did no longer auto refresh.

I did change the code using BECS but tested in Google Chrome. Maybe someone will find a reason why it's working on some systems, while others won't work as expected.

Update: TIV of the script is rather old (1812). Thats the TIV of the LN 10.2 system. Still worked when changing to latest TIV 2310 in the child session.

vahdani
16th March 2021, 16:50
Hi Andreas,
as you say this may have something to do with the setup!

In may case I have tested with a GUI-Sender and a Gui-Receiver and an LN UI-Receiver under Chrome (see below) and in my test only the GUI-receiver actualises with no user interaction! By the way I used your prcm example with refresh.all.occs():cool:

Any case a tip from Infor experts is appreciated :)

andreas.toepper
17th March 2021, 08:26
Are we talking about one sender and two receivers using different clients? So sending from worktop and receiving in LNUI (second login)?
I don't know whether this 'global' messaging and refreshing will work. I did my implementation based on a single login. I think prcm is bound to one login (bshell).
My reference guide knows of another communication way: interprocess communication on OS level, while prcm is interprocess communication on bshell level.
(Search: "bms messages: sample program"; the related topics at the bottom of the page will show the links)
I did never used this way of sending messages across bshells. And an example code is missing in the reference guide.

Geht es hier um Bshell übergreifende Nachrichten? Die PRCM-Funktionen, die ich hier genutzt habe, arbeiten (soweit ich das versehe) nur in einer Bshell. Im Reference-Guide bin ich aber auf eine zweite Methode gestoßen, die offenbar gedacht ist, um Nachrichten über Bshell-Grenzen hinweg zu senden.
(Findet man unter „bms messages: sample program“; am Seitenende sind die Links zu finden)
Die Methode habe ich selbst auch noch nicht genutzt. Es fehlt leider auch eine Beispiel im Reference Guide von Infor.

martin.f
17th March 2021, 13:34
My goal is to have a session on monitor (e.g. warehouse orders session) that refreshes automatically without any user interaction. (many potential senders)

Vahdani demonstrated that this works with GUI but not with LN UI.

Does anybody know how this works with LN UI?

martin.f
17th March 2021, 21:05
Also thank you Andreas for your detailed help. I appreciate this community.

I've also tried your code fragment and it is not working on my system (LN UI).
Google Chrome & IE

Under my understand it must be on OS level, right?
For example, one user creates a warehouse order (separate bushell) and I want to see this order in my list (separate bshell) without interaction.

Regards
Martin

vahdani
18th March 2021, 09:59
Hi Martin,

Your Solution with setting the timer with set.timer() and catching the timer with choice,interrupt has always been the correct solution in GUI times that I had used myself for exactly similar situation that you describe! I tried this a couple of day ago and it does still work in GUI and not in LNUI! The documentation does not mention this!!

The question we should put to directlyto Infor ist why this does not work in LN UI? And if there is a way/trick one could activate the timer mechanism in LN UI?

alles Gute und bleib gesund!

andreas.toepper
19th March 2021, 08:31
There's an option in the user data template where you can enter a refresh rate. Maybe this is still working (the parameter is still presend in LN 10.7). From TIV 1800 on there's also a function to overwrite this setting: set.refresh.rate(..)

But's it grouped with character based windows (classical gui), so it may be depreciated, too. (But adding a char based funkction with ES8.8 sounds weird, doesn't it?)

martin.f
19th March 2021, 09:35
Hello Andreas,
Yesterday I found a solution for this problem:

see also KB 1891460

Like you said, each user is linked to a standard refresh rate (user template ttams1110m000).
This refresh rate can be overwritten with the function set.refresh.rate(time in seconds)

However, refresh only works for sessions with standard form command "auto refresh" on German "Aktualisierungsintervall festlegen".
This was disabled for session warehouse orders.

Now everything works as expected.

Regards
Martin

BaaNovva
6th April 2021, 21:01
I have a custom display session which basically shows item data. This data needs to be in sync with the Maintain Item data. how can i have the screen automatically refresh without having the user choose the 'refresh' option? Can it refresh every 10 seconds automatically? i can use the function werebuild(1) or refresh.curr.occur().....but how can i trigger this function without the user even touching the keyboard or mouse??

thanks!!!

Sometimes displays/refresh simply does not work as expected.
I had similar issues on a single field maintain session with all other fields as display. So when your display session gets opened and during synchronizing with Item master, when a particular field undergoes a value change, do the following under when.field.changes:, add all three display methods as given below. At least one would trigger an auto refresh to the changed field.
This works fine for me, repeat this for all fields that may undergo changes :
when.field.changes:
display.all()
execute(display.set)
execute(find.data)