Saturday 13 April 2013

Automatically Invoking the SL Standard (r) custom screen using Solomon object model

What is SOM? 
Solomon object model (SOM) is an automatic process for invoking the SL Standard (r) custom screen. The set of all members (properties, events, and methods) of a COM component, In the Microsoft Dynamics SL Object Model, this includes information about the SIVApplication and SIVToolbar objects and their members.

SOM reference in Visual Studio


IF the reference is not in that above window Screen

Click Add  à pick your reference à Click OK 


SOM Name Space Declaration  
Imports Microsoft.Dynamics.SL.ObjectModel
Imports Microsoft.Dynamics.SL.ObjectModel.SIVToolbar
Imports Microsoft.Dynamics.SL.ObjectModel.SIVApplication
Imports Microsoft.Dynamics.SL.ObjectModel.SIVControls
Imports Microsoft.Dynamics.SL.ObjectModel.sivMessageType
Imports Microsoft.Dynamics.SL.ObjectModel.

Module Declaration 
            Include Screen control  in Separate module

SOM Control
     1.  SIVApplication
Manipulate SIVControl using the reference returned by the Key Controls property. These         controls are also contained in the Controls collection
                Example:
                      To point to a control in a screen's Controls collection
                      cbatnbrb = SIVApp.Controls("cbatnbrb")

2.  SIVTb
A state of the toolbar that allows users with the proper rights to open applications and make changes to fields that are normally for display only.

            3.  SIVControl.
                   A SIVControl is only accessible as a member the Controls collection of a SIVApplication object.  
                   Once you have located in the collection a SIVControl object that you want to work with, you can 
                   set an object variable of type SIVControl to point to that collection member.

   Function’s for automatically invoking the SL Standard Screen from Custom screen

          a.  SL login

        'Solomon Login
        ContinueProcess = SolLogin(SIVTb, SIVApp)
        If Not ContinueProcess Then GoTo End_Script_App

    b.  Appstart

                    'Starting Application
                       ContinueProcess = AppStart(SIVTb, SIVApp, voucherprocess)
                       If Not ContinueProcess Then GoTo End_Script_App

     c.  AppctrlInstantiate

        'Instantiating SIVToolbar controls
        ContinueProcess = AppCtrlInstantiate(SIVTb, SIVApp, voucherprocess)
        If Not ContinueProcess Then GoTo End_Script_App

     d.  SolLogout

         'Logout toolbar
        ContinueProcess = SolLogOut(SIVTb, SIVApp)
        If Not ContinueProcess Then GoTo End_Script_App

Why Timer controls use
  • Time delay for invoking the SL Screen automatically.
  • The timer interval can be between 0 and 60,000 which means one minute timer is firing.
  • A typical response is checking the system clock to see if it is time to perform some task.
  • The Timer activity can be stopped on click of the Stop button where the processing won’t be happening anymore till the user start the process again on click of Start button.








No comments: