baanhp
25th July 2012, 10:49
Dear All,
While creating sales order if any signal code is attached to Item code then hust a warning comes but sales order line is getting created successfully while we do this through fron end tdsls4100m000
Same when I do using DAL the SO line is also getting created but I am not able to capture that warning message .Only error is captured using dal.get.error.message(). But warnings are not captured in this function .
Is there any special BAAN function available in Infor ERP LN to capture the warning message or any other way around to capture the different warning message that comes while SO and SO line creation using DAL
Thanks and Ragards
Haraprasad
bdittmar
25th July 2012, 11:15
Dear All,
While creating sales order if any signal code is attached to Item code then hust a warning comes but sales order line is getting created successfully while we do this through fron end tdsls4100m000
Same when I do using DAL the SO line is also getting created but I am not able to capture that warning message .Only error is captured using dal.get.error.message(). But warnings are not captured in this function .
Is there any special BAAN function available in Infor ERP LN to capture the warning message or any other way around to capture the different warning message that comes while SO and SO line creation using DAL
Thanks and Ragards
Haraprasad
Hello,
try to use :
dal.get.first.message()
Syntax:
function boolean dal.get.first.message (long i.type, ref string o.code, ref string o.text [, ref long o.type])
Description
Returns the code and text of the oldest message of the given type. In case MSG.ALL is passed as the type, then the type of the message is returned in the 4th argument.
Arguments
long i.type A message type.
Parameter i.type should be one of the following values:
MSG.ALL, MSG.ERROR, MSG.WARNING, MSG.INFO.
ref string o.code The returned code of the message.
ref string o.text The returned text of the message.
[ref long o.type ] Optional, the returned type of the message, in case MSG.ALL was passed as the first argument.
Return values
This function returns TRUE if a message could be retrieved, else FALSE is returned.
Context
This function can be used in DAL script types.
Example
Suppose you want to retrieve only warning messages from the DAL buffer and write them to a file in FIFO order:
string msg.code(14)
string msg.text(132) mb
while dal.get.first.message(MSG.WARNING, msg.code, msg.text)
| Write the message code and text to a file...
...
endwhile
Regards
baanhp
25th July 2012, 11:59
Thanx Bernd for quick reply!!
I have already tried using this, but unfortunately it doesn't work. its returning blank msg code and blank msg text. I think this function servs the purpose when message is coming from DAL not from UI. As item signal getting poped up from Item General UI script not from DAL.
I have also tried void show.dal.messages( [long i.type] ), its also not working.
Please help me out in capturing msg from UI script.
zardoz
25th July 2012, 12:36
Maybe is an info message, not a warning...
try:
show.dal.messages(MSG.INFO)
baanhp
26th July 2012, 05:47
hi zardoz
I have also tried this option and other options as per your suggestion .
But its returning blank message code and blank message text .
I think the message coming from Application layer can not be captured when we create Sales order using DAL.new and dal.save .
Please suggest if any other way around I can try
Regards
Haraprasad
baanhp
26th July 2012, 06:33
Dear BAAN Guru,
Is there any way/standard function available by which we can trap all the warning message written in the UI script of a session .If yes then it can also solve my purpose .
could you please throw some light on this alternative way
Hello,
try to use :
dal.get.first.message()
Syntax:
function boolean dal.get.first.message (long i.type, ref string o.code, ref string o.text [, ref long o.type])
Description
Returns the code and text of the oldest message of the given type. In case MSG.ALL is passed as the type, then the type of the message is returned in the 4th argument.
Arguments
long i.type A message type.
Parameter i.type should be one of the following values:
MSG.ALL, MSG.ERROR, MSG.WARNING, MSG.INFO.
ref string o.code The returned code of the message.
ref string o.text The returned text of the message.
[ref long o.type ] Optional, the returned type of the message, in case MSG.ALL was passed as the first argument.
Return values
This function returns TRUE if a message could be retrieved, else FALSE is returned.
Context
This function can be used in DAL script types.
Example
Suppose you want to retrieve only warning messages from the DAL buffer and write them to a file in FIFO order:
string msg.code(14)
string msg.text(132) mb
while dal.get.first.message(MSG.WARNING, msg.code, msg.text)
| Write the message code and text to a file...
...
endwhile
Regards
vahdani
26th July 2012, 15:26
Hi,
there is (as far as I know) no way to capture the warning messages that are in a UI in your own script. As you already mentioned only the DAL error messages are returned if you use the DAL functionality. There is a very good reason for this: A UI session is usually used by a real person which may be intersted in and are eventually able to react to warnings. :rolleyes: