我需要通过 C# 应用程序使用 Microsoft.Dynamics.BusinessConnectorNet.dll 将 pdf 文件插入 Ax 数据库。
我引用这篇文章https://msdn.microsoft.com/EN-US/library/aa868997(v=ax.50).aspx .
AX 列类型是容器。
当我插入二进制数组时,ArgumentException 说:
The supplied method arguments are not valid.
将文件插入 AX 数据库的数据类型应该是什么?
最佳答案
我想您必须使用 AxaptaContainer
类来传递容器中的值。
AxaptaRecord axRecord;
try
{
// Login to Microsoft Dynamics AX.
ax = new Axapta();
ax.Logon(null, null, null, null);
// Create a new AddressState table record.
using (axRecord = ax.CreateAxaptaRecord("TableName"))
{
// Provide container for record field.
AxaptaContainer axContainer = ax.CreateAxaptaContainer();
axContainer.Add("Some Data");
axRecord.set_Field("ContainerField", axContainer);
// Other fields
// Commit the record to the database.
axRecord.Insert();
}
}
catch (Exception e)
{
Console.WriteLine("Error encountered: {0}", e.Message);
// Take other error action as needed.
}
我还没有测试过,所以请提供一些反馈,以便我们改进解决方案。
关于c# - 使用 Microsoft.Dynamics.BusinessConnectorNet 插入 pdf 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30070849/