Thursday, August 2, 2012

Problem with MsgGetExplainText function


We use MsgGetExplainText() to get the message from message catalog explain text part to display as a error or message or warning.

In PT8.49 onwards, the function is returning the text twice. for example if the text is "show me as a error message", the output will be like

show me as a error message
show me as a error message

To get rid of this bug, we need to clear the second message which is in the buffer.
use it as below.

&error= MsgGetExplainText(28000,12,"Message not found");
&novalue=MsgGetExplainText(99999,1,"");/* 99999,1 should not have any text*/
error (&error);

or this way.

&error= MsgGetExplainText(28000,12,"Message not found");
&error=MsgGetExplainText(99999,1,&error);/* 99999,1 should not have any text*/
error (&error);

Hope it will be useful for you.