en@frrom
2nd January 2007, 15:56
In a customized update session I manipulate the text control a little, as follows:
If no text present and user hits text button, then (in the choice.text.manager: before.choice- section) a default text is created and stored for the record, and the text window is then opened by the regular text handler, thus with the newly created text in it. The user can then add to the default text and save (or choose not to add:change anything, and then the text will be deleted when user exits).

Problem is: when closing the text field, the system always comes up with message ttstps0176: "Record modified by other user; new values are displayed". I want to avoid/overrule this message, but didn't manage to do so yet. I tried refresh() and display.all(), no result...

george7a
2nd January 2007, 16:13
Hi,

Check the following threads:
http://www.baanboard.com/baanboard/showthread.php?t=26433
http://www.baanboard.com/baanboard/showthread.php?t=25149

I hope it helps,

- George

en@frrom
3rd January 2007, 12:32
George,

Thanks for your reply; indeed the issue was solved by using interrupt(). I don't however fully understand what interrupt() is meant to do. The Baan help documentation on choice.interrupt says: "Do an action each time interval". In fact I assume it just refreshes the screen... Can anyone give information on the exact functionality of this function?

Kind regards,
Eli Nager

csecgn
4th January 2007, 14:06
Not for the exact functionality, but I can show you an example where we use it for a timer event. The advantage is, that it runs "in background". You can use the form like normal, but every x seconds a status becomes an actualisation.

choice.cont.process:
on.choice:
ret = input.string("Automatische Aktualisierung",
"Interval in Sekunden:" , 2, 2 , myvar2)
if ret and isdigit(myvar2) then
if lval(myvar2) < 30 then
message("Intervall muss mindestens 30 Sekunden betragen")
choice.again()
else
if lval(myvar2)\10 = 0 then
myvar = lval(myvar2)
start.timer(5)
else
message("Nur in 10-er Schritten möglich")
choice.again()
endif
endif
else
choice.again()
endif
choice.user.0:
on.choice:
stop.timer()

choice.interrupt:
on.choice:
myvar = myvar - 5
if myvar <= 0 then
myvar = lval(myvar2)
display.all()
else
display("myvar")
endif
...

functions:
function start.timer(long i.interval)
{
timer_id = set.timer(i.interval*1000)
display("myvar")
...
}

function stop.timer()
{
kill.timer(timer_id)
...
}

...



BTW: Another possibility to update the screen after modification from program scripts is

refresh.curr.occ()
refresh.all.occs()

placed directly after the commit.transaction() that updates the actual table.

hth

Regards
csecgn

DDPatel
5th August 2021, 07:40
Hii there,

I have been getting same error while modifying record...

I have checked all the similar threads but didn't get success.

And my scenario is different, I have not wrote any program script at session level and Table level, but still getting this error. My data coms from another session.

FYI : My session type is Maintain + List window
What would be the issue?

Thanks in advance.
Regards.
DDPatel

DDPatel
6th August 2021, 13:53
Problem Solved,
Reason : One of the field has invalid value in table.