Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Handling Warnings in Connector - Using MSO screens 2

Status
Not open for further replies.

Guest
I am using Connector via Delphi to create Stores Sales Requisitions. When I get to item 3 on the second MSM14BA screen, I execute the command:
gobjMIMSX.Screen.MSO.Commands.Item('OK').Execute;
and then I may get a Warning message - Total Value Requires Authoristion. If I OK this with the command:
gobjMIMSX.Screen.MSO.Commands.Item('OK').Execute;
The requisition is created.
If I do the same actions manually via the MSO screens the second OK does not complete the req, but allows me to put item 4 on the same screen.
What am I doing wrong. Should the Warning messages be answered with an OK? OR with some other command?
 
You can check available commands using this VB codes.

sFuncKeys = "Function Keys/Commands on screen " & _
Trim$(.Screen.MSO.Name) & vbCrLf
For iFuncKeys = 1 To .Screen.MSO.Commands.Count
sFuncKeys = sFuncKeys & CStr(iFuncKeys) & " " & _
.Screen.MSO.Commands(iFuncKeys).Name & "; " & vbCrLf
Next iFuncKeys
MsgBox sFuncKeys

Thanks to PhantomPhil for the code.
 
You will have to enter the item 4 details prior to executing the OK. Works the same using connector scripts or the online screens - you need to enter both items first.
 
As noted by Drw, it should work the same using connector scripts or the online screens.

I think the logic of the online screens is: if you have filled up all items on the screen, then you will be presented with the next (blank) screen for further entry; if you enter some data, but do not fill the last item on the screen, then the assumption is that you have finished entering items, and you are then taken back to the calling screen.

As for Connector code:
I've found it best to know exactly what you are OK-ing. So do an explicit test for a warning before doing the gobjMIMSX.Screen.MSO.Commands("OK").Execute (otherwise you might not actually have a warning and might be Ok-ing a confirm step or something else)

I've found the following (VBA) connector code useful for testing for warnings:
Code:
If (Mid(Trim$(gobjMIMSX.Screen.MSO.Error), 11, 7) = "WARNING" _
   Or Mid(Trim$(gobjMIMSX.Screen.MSO.Error), 1, 1) = "W") Then
  'Warning, save message if necessary, then OK to dismiss warning
  gobjMIMSX.Screen.MSO.Commands("OK").Execute
End If
In theory all Mims/Ellipse warning messages have a "W" in the first character of the error code string (whereas errors have an "X"). For you folk who have some sort of sysadmin access, you can see this indicator as the 11th associated character (ERROR SEVERITY) against codes on the "ER" table (via MSO011).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top