Accessing Dynamics SL Controls in VBA using sivMyApp.

The Dynamics SL object model documentation uses sivMyApp as the sample variable name to refer to an instance of SIVApplication. When using the object model, the developer has to instantiate it and can name it anything.

It’s also always available in the Customization Manager using that name and can be called from VBA, although I don’t think that’s officially documented anywhere. You don’t have to instantiate it in the Customization Manager. I have used it, or seen it used, this way in versions 2011-2018 and it sounds as though this was true in earlier versions, too.

You can get a control’s value like this (if it’s named “cControlName”):
myVariable = sivMyApp.Controls(“cControlName”)

You can click a button named cmdOK like this:
sivMyApp.Controls(“cmdOK”).value = 1

You can change the background of a textbox like this:
sivMyApp.Controls(“cControlName”).Properties(“backcolor”) = RGB(255, 255, 0)
That will make the background of a control named “cControlName” yellow.

The official way to change properties in the customization manager is using the SetProps function

Leave a Reply