SendKeys doesn’t work in BSL customizations in Dynamics SL 2015

An upgraded BSL (Basic Script Language) customization that used SendKeys displayed System Message 10058 “Basic Script Language execution error 5 – Illegal function call” when the code reached the line with SendKeys in Dynamics SL 2015. SendKeys was used correctly and the customization worked fine in the previous version. It still appears in the BSL documentation for Dynamics SL 2015, but the interpreter calls it an “illegal function” now. The resolution, in this case, was to “upgrade” the customization to VBA. It then worked fine with no other change.

By way of reminder, open the screen containing the BSL customization at the same level as the customization, for example “All Users”, and enter the VBA editor to upgrade the BSL customization to VBA. You will see a dialog box asking if you want to upgrade it. Answer “Yes” to convert it to VBA.

BSL was generally more reliable than VBA IMHO, and up until version 2015 always installed and available, whereas that was not necessarily true of VBA customizations. I’ve never considered converting to VBA an upgrade, but now it’s necessary, since BSL is officially deprecated in version 2015.

Another note: the upgraded customizations contain the old SAF control type names, for example SAFMaskedText. If you move a Masked Textbox on a Dynamics SL 2015 screen that hasn’t been customized, the control type name in the customization will be DSLMaskedText. The customizations still work with the old type names.

Leave a Reply

20 + eighteen =