【发布时间】:2010-12-08 20:02:55
【问题描述】:
我的公司希望我在所罗门创建一个自定义屏幕,以从数据库中的表中加载一些数据。
他们说使用了 Visual Studio .net,我看到手册说使用 VBA。
我应该使用什么? VBA 还是 Visual Studio 5?
如何创建新应用程序?
【问题讨论】:
标签: microsoft-dynamics dynamics-sl
我的公司希望我在所罗门创建一个自定义屏幕,以从数据库中的表中加载一些数据。
他们说使用了 Visual Studio .net,我看到手册说使用 VBA。
我应该使用什么? VBA 还是 Visual Studio 5?
如何创建新应用程序?
【问题讨论】:
标签: microsoft-dynamics dynamics-sl
我们收到了客户的类似要求。我们使用的是 Dynamics Solomon 2011。经过一番研究,我们发现我们需要先安装 VS 2008 来创建一个开发环境,然后再在上面安装 Solomon。在 VS 之后安装 Solomon 会在 Visual Studio 中设置一些项目模板用于 Solomon 开发。
https://community.dynamics.com/product/sl/f/35/t/80585.aspx
也有一些谈话指出,在为 Dynamics Solomon 开发时不建议使用 VS 2010。
我还相信有用于 Dynamics Solomon 的 SDK,您可以在应用程序中使用它来连接到 Solomon 数据库并使用数据对象。我们还没有尝试过,但我们发现了一些关于使用此 SDK 开发代码的参考资料。
以下是使用 Solomon SDK 的示例代码:
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
}
}
}
【讨论】: