Warning Message Count (html)

peter_hamilton

Well Known Member
Hi,
Sorry for the long post, but I thought I'll try and give an explanation of the problem.
But the short & sweet of it is, I want to obtain the actual number of unseen warnings messages in P4210 under html.

Some forms (e.g. P4210) have a "Accept/Reject" changes form. These are invoked in the OK button clicked event, and should be called when there are no errors, and when the warning messages have been shown once.
My problem is that the std BSFN to return the warning count B9800250 (GetErrorCount) returns the number of warning message currently displayed. This is NOT the count of the unseen warning messages. And it would return a count of 2, when there is one unseen warning message and one seen warning message. And if OK pressed again, then the warning count would then be 1 (decreased as very 1st warning message finally disappears).
My problems arise because the code in the P4210 OK ER, states that on the second pass (where first pass had a warning message) the Accept order screen should be shown – whether or not there are any unseen warning messages.
Now, I have added code to the OK button, to set on an errors if certain problems have arisen. When an error occurs, I stop the OK from processing. But because the OK has been processed, the warning message is now classed as seen (to the tool), but not by the warning count. I can get around this once (by moving get warning count higher), but when new warning messages are displayed and the OK button is pressed, I no longer know whether the warning messages have been seen or not.

You can demo this by:
1). Have a version of P4210, that has Accept Order PO on, and that displays the header screen first.
2). Enter SO Detail (ok header screen first (twice) and then go onto the SO detail screen).
3). Press OK in the sales order entry screen (Warning should come up).
4). Now change an order line, with 1 warning resulting (e.g. zero unit price).
5). Press OK. (The Accept order screen will come up). But if you press accept, the screen stays where it was, since this was a NEW (unseen) warning.

The above scenario has more problems than this, when you add code into the OK button to set on errors when certain conditions arise (as per the current changes for the client), and when multiple warning messages can come and go on grid lines.

Now, I managed to get around this problem on the fat client, by referencing the old messages previously displayed (lpBhvrCom->lpObj->lpFormHdr->nNumOldErrRecords) and subtracting this value from the current warnings count.
My problem, is on HTML.
For some reason, referencing lpBhvrCom->lpObj->lpFormHdr->nNumOldErrRecords via a c BSFN in html does not work (i.e. calling the same BSFN that worked on the fat client).
I then found the BSFN B03B0033 (which is called from P03B102). On the fat client, if you have an error in the work-with form (W03B102A) and you press find (e.g. enter an invalid payor) it notes that there is an error, and it stops the find from happening.
If you try this under html, the BSFN does not work and the find button is processed.

Anyone got an idea, what the error structure is under html, and how to go about interrogating it?

Thanks,
 
Back
Top