Joy Conner
14th November 2002, 17:19
Has anyone received a message stating "Unknown Message"?


Joy

baanprog
14th November 2002, 19:41
Do u mean a message() or a fatal error or a message when running a session and doing some operations or while programming?

Joy Conner
14th November 2002, 19:47
This not a fatal error. This is a message box that states "Unknown Message".

baanprog
14th November 2002, 20:00
When does this message come?

mark_h
14th November 2002, 20:15
Could it be that one of the messages in whichever session has been deleted? Do you see a message number in the message box?

Mark

Joy Conner
14th November 2002, 20:25
I use Qkey for customizations and have some customizations attached to tdinv1101m000.

I have a library of custom functions. One of the functions executes a VB script that reads serial port to retrieve data. The function returns a value stored in variable named order.weight.

In the session tdinv1101m000 I call the function as follows:

order.weight = read.serial.port() and I get this message. I step through the code and see that the call to read.serial.port is executing and returning the correct value. I have been trying to isolate the problem, so I comment out the above line and replace it with order.weight = 9.62 and I do NOT get the message.

I think my problem is structural so I generate a custom session with same variable placed on the form. Each time I press the continue key, it executes the same function displays the value on the form. It works in custom session without message box stating "Unknown Message".

Joy

Joy Conner
14th November 2002, 20:55
The message is attached.

Joy

Joy Conner
15th November 2002, 21:15
I have generated a report session.

Now there are not Qkey customizations. Just a BaaN script. Three fields on the form. The code reads as follows:

field.quantity:
when.field.changes:
weight = read.serial.port()
display("weight")

When I put a value into the quantity field on the form, this produces error in attached message.

Also, on the form is the continue button. In the code, same program, the program reads
Choice.cont.process:
on.choice:
weight = read.serial.port()
display("weight")

When I press the continue button on the form, the weight is displayed and no message is display. The program behaves as I had intended.

I'm still stumped.

Joy Conner

baanprog
15th November 2002, 21:43
I think the problem lies in read.serial.port() function, it is stepping on the standard program flow and causing this problem, most probably.

I have come across an instance where the message will not be displayed when it is in choice.cont.process, but I dont remember how and when.

what is the code inside the read.serial.port() function, can u please post it also.

Joy Conner
15th November 2002, 22:01
I thought so too. But that does not explain why it works when it is executed via the continue button.

mark_h
16th November 2002, 00:14
Glad to see someone besides me using Q-key. Does this happen the minute you get to the When.field.changes section or the minute you step into the weight = read.serial.port() statement?
Are you calling a DLL? I was just wondering what that function main() was for - I have never put that in my DLL's.

Mark

Joy Conner
16th November 2002, 00:23
Hi Mark.

Thanks for your attention. The function is buried in a dll and the dll is identified in the list of attached libraries.

Joy

mark_h
16th November 2002, 00:32
Hi Joy!

(1)Does it unknow message happen the minute you get into the when.field.changes section?

(2) Or does it happen the minute you execute the weight = read.serial.port() DLL Function?

And 3 was a curiosity question-

(3) What purpose does the function main() server?
I have never used it?

Mark

Joy Conner
16th November 2002, 00:36
I forgot to answer your other question....

field.weight:
when.field.changes:
weight = read.serial.port()
display.all() <<<<<<<< this line produces the message.

I thought "function main()" was required in dll's. My consultants did that and I followed their practice, never questioning it.

Joy

mark_h
16th November 2002, 00:47
I think what is happening is that it is looping. Try putting the display("weight") in another place. Maybe in the next fields before.input section.

Mark

mark_h
16th November 2002, 00:51
I just read my reply - not sure if that fixes the looping. It looks like what would happen is that you change the weight and this activates the when field changes section. Then you change the weight again and this I think would re-activate the when field changes section when you do the display. So I think it needs to move, but I am not sure where.

Mark

shah_bs
16th November 2002, 03:57
Using when.field.changes would imply a keyboard or scanner input, and since the function read.serail.port() is not a form of keyboard input, I would suggest placing the weight=read.serial.port() in the before.field: sub-section. There would then (most probably) be no need to use the display.all() function.

Although, the primary question about the unknown message remains unanswered ...

baanprog
16th November 2002, 13:00
Remove the function main() it is not necessary in dll's.

function main() is used in 3GL scripts and all the code is written in it.

baanprog
18th November 2002, 22:03
Joy,

Did it get resolved?

Regards

Joy Conner
18th November 2002, 22:18
After much pain on this one, I discovered that the following structure works....

dll Library (as posted last week with no changes)

function domain tcwght read.serial.port()
{
code
"
"
return(weight)
}

Subsession as follows............
declaration:
extern domain tcwght order.weight
before.program:
order.weight = read.serial.port()
put.var(parent, "order.weight", order.weight")
end()

Mainsession as follows..............
declaration:
extern domain tcwght order.weight

field.tdinv100.dqan:
after.input:
zoom.to$("subsession", z.session, "","",0)
display("order.weight")

Perhaps someone can explain why this structure is necessary or why my old structure did not work. The function in the library is executing a program on client. This is the first time I have attempted to implemented this type of logic.

Also want to thank those who gave attention to this.

Joy Conner

sant123
17th March 2003, 18:37
Joy,

have an update session to modify certain fields in Item Master, validation of an Item is done with the Item data from another system I am using app_start to invoke the other system and check if the Item is valid for update, and I get the Unknown Message error. If I comment validation of an Item everything works just fine. There are lots of display and display.all functions, and it works fine if I donot invoke the validation process using app_start.

My doubt is does the standard process gets inturupted if you call the app_start in check.input or after.input section.

Thanks for any help.

San.

Iao_Scaglia
7th March 2017, 16:55
hello to all,
I reply to this post because I have the same problem of Joy Conner.
I create a VB script which calls a DLL with OLE to make same action like open sales quotation, open customer, insert a new sales order etc ect.
Every works fine if I have to open a session but if I want to open the sales order and execute the event of inser new rk, execute(add.set), the system returns "Unknown message".
Please help me.

regards
Sergio

Joy Conner
8th March 2017, 00:19
Have you tried this thread (http://www.baanboard.com/baanboard/showthread.php?t=13194&highlight=unknownhttp://)?

Iao_Scaglia
8th March 2017, 09:21
I don't use app_start().
below my script:
DLL:
...
zoom.cuno = cuno
export("zoom.cuno", zoom.cuno)
zoom.to$("tdsls1101m000",z.session,"tuscadllauto","", 0)

In sales quotation:
before program:
...
if zoomfield$ = "tuscadllauto" then
import("zoom.cuno", smi.cuno)
endif

form.1:
init.form:
...
if zoomfield$ = "tuscadllauto" then
if lval(smi.cuno) <> 0 and background then
ignore.first.event = true
get.screen.defaults()
tdsls001.cuno = smi.cuno
execute(add.set)
endif
endif

when the program execute the before.input of tdsls001.qono the "Unknow message" is shown.
If I delete the before.input of tdsls001.qono the message is shown after the choice add.set.
:(