Quantcast
Channel: Microsoft Dynamics SL
Viewing all articles
Browse latest Browse all 14968

Forum Post: RE: Get a field into other screen

$
0
0

You can do that in two ways, the first is with ApplSetParmValue function and the second is with objectmodel using the StartAppAndAutomate function.

---------------------------------------------------First option-------------------------

--Initiator Screen

   Dim sCustID As String

   Call GetBufferValue("bCustomer.CustID", sCustID)

   If Trim(sCustID) <> "" Then

       Call Edit_Save

       Call ApplSetParmValue(PRMSECTION_VBRDT, "CustID", Trim(sCustID))

       Call ApplSetParmValue(PRMSECTION_VBRDT, "ShipToID", "DEFAULT")

       serr1 = Launch("xUsr_Screen\xFE0200.exe", True, True, 0)

       Call Edit_Cancel

   End If

--Target Screen

Option Explicit

Dim sCustID As String

Dim sShipToID As String

Private Sub Form1_Display()

   If Trim(sCustID) <> "" Then

       Call SetObjectValue("cCustID_0", Trim(sCustID))

       Call SetObjectValue("cShipToID_0", Trim(sShipToID))

   End If

End Sub

Private Sub Form1_Load()

   sCustID = ApplGetParmValue(PRMSECTION_VBRDT, "CustID")

   sShipToID = ApplGetParmValue(PRMSECTION_VBRDT, "ShipToID")

End Sub

-------------------------------------------Second Option---------------------------------------

Dim sDataEntity      As String

    Dim WithEvents SIVApp As SIVApplication

    Dim iSolErr As Integer

    Dim iOSErr As Long

Call SetStatusBarText("Abriendo el Programa", "")

Set SIVApp = StartAppAndAutomate("AU\AU01900.EXE", iSolErr, iOSErr)

If iSolErr <> 0 Then

           Call Mess(iSolErr)

           Exit Sub

       End If

       If iOSErr <> 0 Then

           Call Mess(7519)

           Exit Sub

       End If

    SIVApp.Visible = true

...Codigo

sDataEntity = sivApp.Controls("cInvtID").Properties("Level")

bRegEncontrado = (SIVApp.First(sDataEntity) = sivRecordFound.sivRecFndFound)

       While bRefEncontrado = 0

sivApp.Controls("cInvtID").Value = "Item Value"

bRegEncontrado = (SivApp.Next(sDataEntity) = sivRecFndFound)

Wend

       sivApp.first sDataEntity

    Call SetStatusBarText("", "")

    SIVApp.Visible = True

    SIVApp.Quit

    Set SIVApp = Nothing


Viewing all articles
Browse latest Browse all 14968

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>