Я не писал запросы к таблице, а старался всё сделать через классы... Вот пример моего кода из С#
X++:
public void OMPPrintAxaptaProcess(string _dummy, string _dummy1)
{
// Create an instance of the Axapta class.
Axapta DynAx = new Axapta();
AxaptaObject axObj = null;
DateTime startTime = DateTime.Now;
// Add the proxy user.
// Replace the ProxyUserID and password parameters with the
// proxy user name and password that you specified
// in the Business Connector Proxy.
//System.Net.NetworkCredential nc = new System.Net.NetworkCredential(Global.userName,Global.userPassword,Global.domain);
//string _filename = Global.filename2process;
object ret = null;
bool logged = false;
// Test the connection to the .NET Business Connector.
try
{
startTime = DateTime.Now;
//DynAx.LogonAs(Global.userName.Trim(),
// Global.domain,
// nc,
// Global.daxcompany,
// Global.daxlanguage,
// Global.daxobjectserver,
// Global.daxconfiguration);
DynAx.Logon(Global.daxcompany,
Global.daxlanguage,
Global.daxobjectserver,
Global.daxconfiguration);
logged = true;
infoMessageEvent("OMP print DAX: Logon successful", EventLogEntryType.SuccessAudit);
axObj = DynAx.CreateAxaptaObject("SEPProcessOMPLabels");
axObj.Call("parmServiceInstanceId", Global.ompServiceInstanceId);
ret = axObj.Call("run");
if (ret != null &&
ret.GetType().ToString() == "System.Boolean" &&
((bool)(ret)))
{
infoMessageEvent("OMP print DAX: completed", EventLogEntryType.Information);
}
else
{
infoMessageEvent("OMP print DAX: failed", EventLogEntryType.Information);
}
DynAx.Logoff();
logged = false;
infoMessageEvent("OMP print DAX: Logoff completed.", EventLogEntryType.SuccessAudit);
}
catch (Exception ex)
{
if (logged)
{
DynAx.Logoff();
logged = false;
infoMessageEvent("OMP print DAX: Logoff completed.", EventLogEntryType.SuccessAudit);
}
infoMessageEvent("OMP print DAX: " + ex.Source + "/" + ex.Message, EventLogEntryType.Error);
}
finally
{
if (axObj != null)
axObj.Dispose();
if (DynAx != null)
DynAx.Dispose();
}
infoMessageEvent("OMP print DAX Time used: " + Convert.ToString(DateTime.Now - startTime), EventLogEntryType.Information);
}