en@frrom
13th February 2006, 15:01
As a result of this thread (http://www.baanboard.com/baanboard/showthread.php?t=26213), I was requested to post the session I created for sending messages to active Baan shells.
It is a very simple and straight forward system, which is just activating the standard Baan messaging functionality (systemmess).
IMPORTANT: In order for this session to work, first the mask pollmess should be active. This can be activated in session ttadv4188m000
Insert a new entry as follows:
mask: pollmess
session/object: ottstppollmess
automaticall add mask : yes
boot : yes
CONVERT TO RUNTIME DD.
Attached are the (compressed) objects, exported via ttiex1280m000. So you can just place it on disc, and import the folder 'baan_messenger' using ttiex1280m000.
I was lazy for the form and used hard-coded text instead of neat labels. You will see that the form is available for languages 1 & 2 (Dutch & English)
Explanation of form-fields:
- There are 4 text fields; I don't think anyone will send longer messages than that, but of course you can add more...
- The option "display message for coming x minutes": with this option the message will appear on any existing bshell, and on any new logon during the next x minutes. NOTE: when this option is selected the session stays active - and hourglass will appear - for the selected amount of minutes.
Without this option the message will be displayed on any current bshell and on any new logon, for unlimited amount of time, untill the message will be removed using option 'remove current message'.
- Option 'remove current message' removes a message placed previously. NOTE: when the message was placed only for x minutes, then it is not necessary to remove the file, for the file will be removed at the end of the x minutes.
Hope this will be usefull. For any questions, of course feel free to ask me at any time!
Cheers,
En
~Vamsi
13th February 2006, 18:35
En,
Could you please post the sources as well. If I remember the format of the dump files is not the same between the different Baan versions.
en@frrom
14th February 2006, 10:36
Here is the code, in attachment you will find the form information including screenshots. Of course there may be differences between different Baan versions. Also, I developed this session in a Baan 5.0B environment. I can't think directly of a reason it shouldn't work in BaanIV for instance, but didn't try it. Would be happy to hear from others..
|******************************************************************************
|* Title : tcrom3080 - Baan Messenger
|* Author : Eli Nager
|* Date : 13/02/2006
|******************************************************************************
|* Script Type : 4GL
|* Copyright 2006 by Eli Nager
|*
|* All Rights Reserved
|*
|* Permission to use, copy, modify, and distribute this software and its
|* documentation for any purpose and without fee is hereby granted,
|* provided that the above copyright notice appear in all copies and that
|* both that copyright notice and this permission notice appear in
|* supporting documentation.
|*
|* ELI NAGER AND BAANBOARD.COM DISCLAIM ALL WARRANTIES WITH REGARD TO
|* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|* AND FITNESS, IN NO EVENT SHALL ELI NAGER NOR BAANBOARD.COM BE LIABLE
|* FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|* OR PERFORMANCE OF THIS SOFTWARE.
|*
|****************************** declaration section ***************************
declaration:
extern domain tcmcs.str100 text1
extern domain tcmcs.str100 text2
extern domain tcmcs.str100 text3
extern domain tcmcs.str100 text4
extern domain tcyesno opt.del
extern domain tcyesno del.mess
extern domain tcmcs.long minutes
domain tcmcs.str35 filepath
domain tcmcs.long fileid
domain tcmcs.long ret.val
domain tcmcs.long hold.minutes
string mess.txt(400)
#define FILENAME "systemmess"
#define TR(x) strip$(shiftl$(x))
|****************************** form section **********************************
form.1:
init.form:
get.screen.defaults()
if opt.del <> tcyesno.yes then
hold.minutes = minutes
minutes = 0
disable.fields("minutes")
display("minutes")
endif
|****************************** choice section ********************************
choice.cont.process:
on.choice:
filepath = bse.dir$()
filepath = TR(filepath) & "/lib/" & FILENAME
if del.mess = tcyesno.yes then
del.file()
else
if opt.del = tcyesno.yes and minutes < 1 then
message("Gelieve eerst aantal minuten te selecteren")
choice.again()
else
display.mess()
endif
endif
|****************************** field section *********************************
field.opt.del:
when.field.changes:
if opt.del = tcyesno.yes then
enable.fields("minutes")
minutes = hold.minutes
if minutes < 1 then
minutes = 1
endif
display("minutes")
else
hold.minutes = minutes
minutes = 0
disable.fields("minutes")
display("minutes")
endif
field.del.mess:
when.field.changes:
if del.mess = tcyesno.yes then
disable.fields("text1", "text2", "text3", "text4", "opt.del", "minutes")
display.all()
else
enable.fields("text1", "text2", "text3", "text4", "opt.del", "minutes")
display.all()
endif
|****************************** function section ******************************
functions:
function display.mess()
{
del.file()
fileid = seq.open(filepath, "wt")
if fileid < 0 then
message("boodschap niet verzonden. Oorzaak: kon bestand niet aanmaken")
choice.again()
else
mess.txt = TR(text1) & " " & TR(text2) & " " & TR(text3) & " " & TR(text4)
ret.val = seq.puts(mess.txt, fileid)
ret.val = seq.puts("-", fileid)
ret.val = seq.close(fileid)
if opt.del = tcyesno.yes then
suspend(60000 * minutes)
del.file()
endif
endif
}
function del.file()
{
ret.val = file.rm(filepath) |remove old message-file if present
}
Regards,
En
deepaksachdeva
25th March 2006, 08:20
Dear En,
do u have the same code for Baan IV c4 ?
deepak
bdittmar
25th March 2006, 18:42
Dear En,
do u have the same code for Baan IV c4 ?
deepak
Hello deepack,
i've seen no problems.
en's code should also do it's job on BaaN IV c4
Regards
en@frrom
27th March 2006, 12:08
Indeed, as I have previously mentioned, I don't see any reason why it shouldn't work for Baan 4C4, please test and let us know...
deepaksachdeva
27th March 2006, 12:41
while importing the dump, system throws an error
error -13 during seq.open file "/backup/baanmsn/installed.path"
pls comment.
with regards
Deepak
~Vamsi
27th March 2006, 18:26
Deepak,
See my earlier post in the same thread. The dump format is not the same. So go ahead and create the form manually and put in the code. Perhaps you can contribute the dump files for version 4 when you are done.
deepaksachdeva
28th March 2006, 06:46
Vamsi,
it would be nice, if u pls put up the screen shot of the form, it helps me to understand the layout.
with best regards
Deepak
en@frrom
28th March 2006, 10:01
Deepak,
In attachment a screenshot of the form, with a little explanation to it.. Hope this will help..
Feel free to ask if you need any further assistance
Regards,
En
deepaksachdeva
28th March 2006, 10:15
Deepak,
In attachment a screenshot of the form, with a little explanation to it.. Hope this will help..
Feel free to ask if you need any further assistance
Regards,
En
I think you have forgotten to attach the screenshot.
could u pls attach again.
with regards
Deepak
en@frrom
28th March 2006, 10:29
My apologies; done.
gurmeetmakkar
3rd April 2006, 09:04
please solv my problem
problem is
how to group comment
en@frrom
3rd April 2006, 09:56
gurmeetmakkar,
Please be a little more specific; I don't understand your request...
litrax
28th April 2006, 12:28
I tried to compile the Script from en@frrom. But the Error "Unresolved reference to function 'disable.fields' " appeared. Do you have any hint for me?
en@frrom
28th April 2006, 12:35
Hello Olaf,
Functions disable.fields() and enable.fields() are available from Baan V only. For Baan IV you can replace it by using 'attr.input = FALSE'. This looks less nice than in Baan V since the background-colour of the field doesn't change to gray, but stays white as for an input field, however it meets its requirement and disables user from input
Regards,
En
litrax
28th April 2006, 13:36
O.k. I expected that I have to do this, but I wanted to be sure, before I change the script.
Thanks...
bdittmar
30th April 2006, 15:40
I tried to compile the Script from en@frrom. But the Error "Unresolved reference to function 'disable.fields' " appeared. Do you have any hint for me?
Hello,
maybe disable.fields() is not working in BaaN IV.
Try to use attr.input = false instead.
Sorry "en" , you've given this hint before.
Regards
NirajKakodkar
30th September 2006, 13:25
hi en@from ,
I wanted to compile your script so to use it wanted to create a session but wen i tried to generate a session with tc rom combination it gave an error saying module not found , is there any way by which we can generate a session wer in we dont have to specify the main table , plz comment
Regards,
Niraj
en@frrom
3rd October 2006, 11:21
Hello Niraj,
The module rom is not a standard Baan module. It is a module I use at our site for our customizations. You can add the session in any module you like (tccom etc), or alternatively create the module rom (which I wouldn't do just for this one session).
Regards,
Eli
NirajKakodkar
3rd October 2006, 11:32
Hi EN@FROM ,
Thank you
But if want to generate a session without specifying the main table how can i do dat , or i'll have to create a new table for that , please comment .
Regards ,
NIraj
en@frrom
3rd October 2006, 11:37
You don't need a main table, for you don't need any Baan table in this session. So you can just write any table, for instance tccom000 or so.
NirajKakodkar
3rd October 2006, 14:39
Thank you EN@FROM
Dats wot i wanted .
Regards ,
Niraj
bdittmar
3rd October 2006, 15:12
I tried to compile the Script from en@frrom. But the Error "Unresolved reference to function 'disable.fields' " appeared. Do you have any hint for me?
Hello,
maybe disable,fields() will not work on BaaN IV.
I don't know if it is backported.
Regards
en@frrom
3rd October 2006, 15:48
?? bdittmar, what's your point to keep on repeating that point. As already explained several times, indeed these functions are available from Baan V only.
NirajKakodkar
18th October 2006, 08:30
Hi En@From ,
I modified your Baan Messenger a bit , wot i found in it was it was only updating the systemmes file , but was not updating ttadv4188m000 so that user had to manually run that session , so i made a little modification so that this processess are automated i am posting the modified code and the form snapshot .
Regards,
Niraj
zakir_h
18th October 2006, 14:12
Hi,
i think u have to include the file <bic_dam> in your script ofcourse in baan v.
Regards
zakir
Rammie
19th October 2006, 18:53
Hi all,
I've been playing with this method of displaying a message on login, however most of our users use Worktop. For some reason when logging into worktop the message is displayed twice. Logging in via BECS it only appears once as required.
Any thoughts?
(For info we're BaanIVc4 on Windows Server 2000)
Thanks,
Dave
NPRao
19th October 2006, 20:17
Dave,
Check in Worktop -> Tools -> Options -> View -> Embed System Message in Work Area.
Also, refer to the thread - BAAN welcome screen setup (http://www.baanboard.com/baanboard/showthread.php?t=26213&highlight=embed)
You can also change the options in - C:\Program Files\Baan\Worktop\Worktop.ini instead of individual worktop documents
; Defines whether system messages must be showed embedded within the Information pane of Worktop.
; Options: 0 = Never embed system messages
; 1 = Only embed messages if Work pane is visible
; 2 = Always embed system messages
; Default: 1
ShowSystemMessages =1
; Only applicable if ShowSystemMessages is set to 1. Define the SystemMessagesInterval variable
; to define the frequency of polling (in seconds) for new messages awaiting on the server.
; Default: 300 (= each 5 minutes)
SystemMessagesInterval =300
en@frrom
20th October 2006, 13:06
Hi Niraj,
First of all sorry for the late response; haven't been much around the last couple of weeks...
As for your modification: ok, but I do not really understand why you had to put time in programming that update in ttadv4188m000. This is a parameter which needs to be set only once per environment (not even per company since its set in the Tools company)... Am I missing something...???
NirajKakodkar
23rd October 2006, 07:15
Hi en@from ,
May be I am wrong but , In our company whenever we have to message BAAN users we send message using systemmess file and select the boot option in ttadv4188 so each time the user boots or login to Baan he gets the message and when we dont want the message to get displayed we remove the boot option , that is what i tried to do .
Is there any other way other than changing the option in ttadv4188 , please comment
Regards,
Niraj
en@frrom
23rd October 2006, 10:12
Hello Niraj,
The way systemmess works, is that if the mask is activated, then there is a check in the ${BSE}/lib directory if the file systemmess exists. If yes, the message will be printed, if not, nothing happens.
It is therefor enough to activate the mask once for the entire system (all companies, all users), and then creating and removing the file systemmess according to the need.
I hope this clears things up.
Regards,
Eli
NirajKakodkar
23rd October 2006, 10:54
Hi En@from ,
Ok , i got it now , what you mean to say is activate the mask and boot option once and dont change it and Whenever you want to display the message create a file systemmess and when you dont want the message to be displayed delete the systemmess file , am i right now .
Regards,
Niraj
en@frrom
23rd October 2006, 10:56
Yes, exactly!
NirajKakodkar
23rd October 2006, 13:13
Hi en@from ,
Is there any sort of BAAN chat client programmed by any one , utility for messaging both side full duplex , If not will it be possible to program it using Baan Tools alone .
Regards,
Niraj
lorry.lu
5th December 2006, 09:27
I modify the script and add some new function! It works well in BaaNIVc4.