What we did was to add a button on the form, make the button the active object 
(using .GiveFieldFocus), make the window the foreground window, and then use 
SendKeys.SendWait("{ENTER}") to push the button.

Code on the button does the Commit Window action (instead of the Submit action 
in the class).  This way all Active Links are processed by the user tool.

Fred

-----Original Message-----
From: Action Request System discussion list(ARSList) 
[mailto:arslist@ARSLIST.ORG] On Behalf Of Linda Bykowski
Sent: Thursday, November 10, 2011 9:12 AM
To: arslist@ARSLIST.ORG
Subject: Unable to open a form in modify mode when a form is maximized

Hi all,

We are trying to do a pop screen action on Remedy User. The following is the 
code sent to the user tool:

Imports System.Runtime.InteropServices
Imports ARUSER
Imports System.Windows.Forms

Public Class RemedyAutomationClient
    Public Function ForwardDataToRemedy(ByVal ticketType As String, ByVal 
phoneNbr As String, ByVal acctNbr As String, ByVal storeNbr As String, ByVal 
waitTime As String, ByVal dbgOn As Boolean) As Boolean
        Try

            Dim remedy As ARUSER.ICOMAppObj_4 = Nothing

            If dbgOn Then
                'Offset spacing below makes message box text lin up
                MessageBox.Show("Received the following paramters:" & 
Environment.NewLine &
                                "ticketType  = [" & ticketType & "]" & 
Environment.NewLine &
                                "phoneNbr   = [" & phoneNbr & "]" & 
Environment.NewLine &
                                "acctNbr      = [" & acctNbr & "]" & 
Environment.NewLine &
                                "storeNbr    = [" & storeNbr & "]" & 
Environment.NewLine &
                                "waitTime    = [" & waitTime & "]" & 
Environment.NewLine &
                                "dbgOn       = [" & dbgOn & "]")
            End If

            Try
                remedy = DirectCast(Marshal.GetActiveObject("Remedy.User.1"), 
ARUSER.ICOMAppObj_4)
            Catch exc As Exception
                Return False
            End Try

            If remedy Is Nothing Then
                Return False
            Else

                    ' Handle the IVR Pop form.
                    Dim frmIvrPop = DirectCast(remedy.OpenForm(0, "HPRemDev", 
"IVR Pop", ARUSER.OpenMode.ARSubmit, 0), ARUSER.ICOMFormWnd2)

                    Dim fldIvrPopPhone = 
DirectCast(frmIvrPop.GetField("Phone"), ARUSER.ICOMField4)
                    fldIvrPopPhone.Value = phoneNbr

                    Dim fldIvrPopContactAccountId = 
DirectCast(frmIvrPop.GetField("Contact Account ID"), ARUSER.ICOMField4)
                    fldIvrPopContactAccountId.Value = acctNbr

                    Dim fldIvrType = DirectCast(frmIvrPop.GetField("IVR Type"), 
ARUSER.ICOMField4)
                    fldIvrType.Value = ticketType

                    Dim fldHoldTime = DirectCast(frmIvrPop.GetField("Seconds on 
Hold"), ARUSER.ICOMField4)
                    fldHoldTime.Value = waitTime

                    Dim fldStore = DirectCast(frmIvrPop.GetField("Store 
Number"), ARUSER.ICOMField4)
                    fldStore.Value = storeNbr

                    frmIvrPop.MakeVisible()
                    frmIvrPop.Submit()
                    'frmIvrPop.Close()
                    frmIvrPop = Nothing

                    remedy = Nothing
                    Return True
                End If

        Catch ex As Exception
            MessageBox.Show("Remedy failed open new request form. Please open 
service request manually")
        End Try
    End Function

End Class

There are active links on the form IVR Pop that either open an existing record 
on our Service Request form or if there are no open issues opens a new Service 
Request.. Opening the Service Request on a submit window works. When submitting 
an IVR Pop and an existing record is found the Service Request does not open 
but an IVR Pop record is created; if multiple records are found a list is not 
displayed and the record id that is returned to the IVR Pop is the first record 
in the result. This scenario only occurs when submitting a record and any form 
is maximized in the User tool. Active links perform correctly when open forms 
are minimized or do not fill the screen.

All workflow works correctly if an IVR Pop is submitted directly on the User 
Tool itself and not through the dll.

My question is what could be causing this? Is there a way to minimize all 
active forms? I don't have the option to close all forms (which does work but 
would impact our users).


Thank You, 
Linda Bykowski 
Sterling Jewelers




_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
attend wwrug12 www.wwrug12.com ARSList: "Where the Answers Are"

Reply via email to