Dynamics SL Object Model Command Line Args

After searching the documentation and internet in vain for anything helpful on this topic, I created two SL SDK applications and used StartAppAndAutomate() to launch the second app from a button on the first. Here’s what I found.

It works! I created two labels on the second form to show the command line arguments passed by the first. I called ApplGetParms() twice on the second form to get each of them. That emulates what a standard SL SDK app would do to retrieve them. The second exe was named “STOBJ01”.

Here’s the code. The first line was at the form level. The rest was in the button handler.

Private WithEvents _sivApp As SIVApplication

Dim parmStr As String = PRMSEP & “2000” & PRMSEP & “Second_Param”
Dim sivErr As Integer
Dim osErr As Long
_sivApp = StartAppAndAutomate(exePath & “STOBJ01.exe ” & parmStr, sivErr, osErr)

Note the space after “.exe” within StartAppAndAutomate. It didn’t work without that. Using the constant PRMSEP here is optional with just one argument, but is required with multiple args.


  1. Clayton December 18, 2023 10:52 am  Reply

    The former user group DSLUG.com (dynamics sl users group) had all that information. But it was shut down and removed shortly after MS announced end of life for Dynamics SL.

    • Delmer Johnson December 18, 2023 11:19 am  Reply

      Clayton, thanks for your comment. I was sad to see the DSLUG web site go away earlier this year. The last digest I received from the site was on Feb. 19. A lot of good content, including conference presentations, were lost. There is a continuing forum on Dynamic Communities. https://dynamicscommunities.com/community/groups/dynamicssl
      I did search the DSLUG forum, as well as other places, before I wrote my post. I often write those to remind myself of things that took a little time to figure out for future reference.

Leave a Reply