Microsoft Dynamics Forums Homepage

Forum Home Forum Home > Microsoft Dynamics SL (Solomon) > SL - Customization and Integration
  New Posts New Posts RSS Feed - Solomon Object Model code
  FAQ FAQ  Forum Search   Register Register  Login Login


Solomon Object Model code

 Post Reply Post Reply
Author
Message
SRobert View Drop Down
MicrosoftDynamicsForums.com Member
MicrosoftDynamicsForums.com Member


Joined: December 09 2005
Location: United States
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote SRobert Quote  Post ReplyReply Direct Link To This Post Topic: Solomon Object Model code
    Posted: January 15 2006 at 10:12am

I am getting following error:

Compile error:
Invalid use of New keyword

Here is my code:

Dim sivTB As New SIVToolbar
Dim sivAPP As New SIVApplication

Private Sub Command1_Click()

sivTB.Login "DBServer", "DemoSys", "demoApp", "SYSADMIN", ""
Set sivAPP = sivTB.StartApplication("0826000.exe")

sivAPP.Quit
sivTB.Logout
Set sivAPP = Nothing
Set sivTB = Nothing

End Sub

In my project I have created references to Solomon IV Toolbar Object and Solomon IV Application Object from Project, References.

Any help would be appreciated!

Back to Top
Sponsored Links


Back to Top
nagesh_boppana View Drop Down
MicrosoftDynamicsForums.com Member
MicrosoftDynamicsForums.com Member


Joined: September 15 2005
Location: India
Status: Offline
Points: 231
Post Options Post Options   Thanks (0) Thanks(0)   Quote nagesh_boppana Quote  Post ReplyReply Direct Link To This Post Posted: January 15 2006 at 7:30pm

Hi,

   Have you added the Activex Object Library reference?

Back to Top
nagesh_boppana View Drop Down
MicrosoftDynamicsForums.com Member
MicrosoftDynamicsForums.com Member


Joined: September 15 2005
Location: India
Status: Offline
Points: 231
Post Options Post Options   Thanks (0) Thanks(0)   Quote nagesh_boppana Quote  Post ReplyReply Direct Link To This Post Posted: January 15 2006 at 7:34pm

Hi,

   Try the following declaration..

Global SolToolbar As SIVToolbar ' in Module

  Set SolToolbar = New SIVToolbar ' in click event..

 SolToolbar.Login sServerName, sSystemDB, sCompanyID, sUserID, Trim(Mid(sPassword, 2, (Len(sPassword))))

SolToolbar.Visible = True

If Err.Number <> 0 Then

  SolToolbar.logout
        SolToolbar.Quit
        Set SolToolbar = Nothing

end if

Thanks,

Nagesh

Back to Top
SRobert View Drop Down
MicrosoftDynamicsForums.com Member
MicrosoftDynamicsForums.com Member


Joined: December 09 2005
Location: United States
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote SRobert Quote  Post ReplyReply Direct Link To This Post Posted: January 16 2006 at 8:47am

Nagesh, your code doesn't work. I get compile error on solToolbar.Visible statement. The error is

Compile error:
Invalid use of Property

Back to Top
nagesh_boppana View Drop Down
MicrosoftDynamicsForums.com Member
MicrosoftDynamicsForums.com Member


Joined: September 15 2005
Location: India
Status: Offline
Points: 231
Post Options Post Options   Thanks (0) Thanks(0)   Quote nagesh_boppana Quote  Post ReplyReply Direct Link To This Post Posted: January 16 2006 at 7:39pm

HI,

    Make sure that no "Set " should be used in the Statement.

           Set SolToolbar.Visible = True

 Thanks,

Nagesh.

Back to Top
StuartN View Drop Down
MicrosoftDynamicsForums.com Member
MicrosoftDynamicsForums.com Member


Joined: June 05 2008
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote StuartN Quote  Post ReplyReply Direct Link To This Post Posted: June 05 2008 at 3:45pm
Was a solution found for this issue?  I'm running into the same thing.  Seems to be related to the sivApplication reference.  When I write code, it does not appear in the dropdown box.

This is in SL6.5SP2

Stuart Nottingham

Back to Top
imthiyaz View Drop Down
MicrosoftDynamicsForums.com Member
MicrosoftDynamicsForums.com Member


Joined: September 15 2005
Location: India
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote imthiyaz Quote  Post ReplyReply Direct Link To This Post Posted: June 12 2008 at 6:27am
 Hi Staurt,
 
         If you are using the VB6 then u have to use this code.
 
 Dim SolToolbar As SIVToolbar
 Dim SolApp As SIVApplication
 
 Set SolToolbar = New SIVToolbar
 SolToolbar.Login sServerName, sSystemDB, sCompanyID, sUserID, sPassword
 SolToolbar.Visible = True
 
 Set SolApp = SolToolbar.StartApplication("XXXXXXX.exe")
 SolApp.Visible = True
 
----------------------
If your are using VB.NET use this code
 

Dim SivTB As SIVToolbar

Public WithEvents sivapp_SH As SIVApplication
 

Private Sub Start_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

SivTB = New SIVToolbar

SivTB.Login(sServerName, sSystemDB, sCompanyID, sUserID, sPassword)

SivTB.Visible = True

sivapp_SH = SivTB.StartApplication("XXXXXXX.exe")

sivapp_SH.Visible = True

End Sub

 
Back to Top
santhanams View Drop Down
MicrosoftDynamicsForums.com Member
MicrosoftDynamicsForums.com Member


Joined: December 26 2007
Location: Chennai
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote santhanams Quote  Post ReplyReply Direct Link To This Post Posted: July 29 2008 at 6:18am
Hi imthiyaz,
        I try to do samething. but i got error (like "Applications cannot be started because the
SolomonObject Model has not been registered.") while executing.
 

Dim SivTB As SIVToolbar

Public WithEvents sivapp_SH As SIVApplication
 

Private Sub Start_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

SivTB = New SIVToolbar

SivTB.Login(sServerName, sSystemDB, sCompanyID, sUserID, sPassword)

SivTB.Visible = True

sivapp_SH = SivTB.StartApplication("XXXXXXX.exe")

sivapp_SH.Visible = True

End Sub

Back to Top
imthiyaz View Drop Down
MicrosoftDynamicsForums.com Member
MicrosoftDynamicsForums.com Member


Joined: September 15 2005
Location: India
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote imthiyaz Quote  Post ReplyReply Direct Link To This Post Posted: July 29 2008 at 7:14am
Hi Shanthanam,
 
     make sure you have registered Object Model Module. You check it from Solomon parent goto Utility -> Registration, Open the Modules tab. There you will find the Object Model is activated or not?
 
Thanks
Imthiyaz.M
Back to Top
dpshepherd View Drop Down
MicrosoftDynamicsForums.com Member
MicrosoftDynamicsForums.com Member


Joined: November 04 2008
Location: Pittsburgh
Status: Offline
Points: 6
Post Options Post Options   Thanks (1) Thanks(1)   Quote dpshepherd Quote  Post ReplyReply Direct Link To This Post Posted: November 04 2008 at 7:44am
I found this on PartnerSource, modified it, and set it up as a console application.  It works very well.

using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.Dynamics.SL.ObjectModel;
using System.Threading;
using System.Runtime.InteropServices;




namespace LoginSL
{
    class Program
    {
        [DllImport("kernel32")]
        static extern void Sleep(uint dwMilliseconds);
        public static Microsoft.Dynamics.SL.ObjectModel.SIVToolbar sivTB;
        public static Microsoft.Dynamics.SL.ObjectModel.SIVApplication sivApp;

        static void Main(string[] args)
        {

            sivTB = new SIVToolbar();


            sivTB.Login("servername", "systemdb", "company", "username", "password");

            sivApp = sivTB.StartApplication("9850000.exe");
            sivApp.Visible = true;

            string datafile = "C:\\0101000.DTA";
            string ctrlfile = "C:\\0101000.ctl";
            string outfile = "C:\\0101000.log";
            //In C# "\\" is the predefined escape sequence for backslash.

            sivApp.Controls["cdata"].Value = (datafile.ToUpper());
            sivApp.Controls["cfiletype"].Value = "ASCII";
            sivApp.Controls["cscreen"].Value = "0101000";

            sivApp.Controls["ccontrol"].Value = (ctrlfile.ToUpper());
            sivApp.Controls["coutput"].Value = (outfile.ToUpper());
            sivApp.Controls["cBegProcessing"].Value = true;

            Sleep(5000);  //remove the comment marks at the beginning of this line for workaround


            sivApp.Quit();
            sivApp.Dispose();

            //GC.Collect();
            //GC.WaitForPendingFinalizers();
            //GC.Collect();

            Sleep(5000);  //remove the comment marks at the beginning of this line for workaround

            sivTB.Logout();
            sivTB.Quit();
            sivTB.Dispose();


            //GC.Collect();
            //GC.WaitForPendingFinalizers();
            //GC.Collect();
            //MessageBox.Show("TI is complete"); // Displays complete message

        }
    }

    }

Back to Top
thillairaja View Drop Down
MicrosoftDynamicsForums.com Member
MicrosoftDynamicsForums.com Member


Joined: April 01 2013
Location: India
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote thillairaja Quote  Post ReplyReply Direct Link To This Post Posted: April 01 2013 at 11:38pm
Hi dpshepherd ,

         I am using your code but i got an error"Unexpected error creating MSDynamicsSL.SIVToolbar.IPCEventWaitHandle"...
Thanks,

Thillai
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down


Copyright 2013 microsoftdynamicsforums.com. All rights reserved. MicrosoftDynamicsForums.com is an independent non-Microsoft website.
Email: contact AT microsoftdynamicsforums DOT com