Ich ziehe Daten aus Dynamics AX 2009 aus C# mit dem folgenden Code-Snippet. Dies funktioniert einwandfrei, außer in Fällen, in denen der zugrunde liegende Feldtyp eine Dimension ist. Ich möchte Array-Typen "abflachen" können, wenn ich sie zurücksende, aber ich sehe keinen Weg, dies zu tun. Irgendwelche Ideen irgendjemand?Wie kann ich ein Array von Dynamics AX 2009 über C# exportieren?
axRecord = ax.CreateAxaptaRecord(tableName);
axRecord.ExecuteStmt(strQuery);
// Loop through the set of retrieved records.
using (StreamWriter sw = File.CreateText(path))
{
AxaptaObject axDictTable = ax.CreateAxaptaObject("SysDictTable",axRecord.get_Field("tableid"));
outputRow = null;
List<int> ids = new List<int>();
for (int i = 1; i <= (int)axDictTable.Call("fieldCnt"); i++)
{
AxaptaObject axDictField = ax.CreateAxaptaObject("DictField", axRecord.get_Field("tableid"), axDictTable.Call("fieldCnt2ID", i));
outputRow += ((string)axDictField.Call("Name")) + ",";
ids.Add((int)axDictTable.Call("fieldCnt2ID", i));
}
sw.WriteLine(outputRow);
while (axRecord.Found)
{
outputRow = null;
foreach(int i in ids)
outputRow += axRecord.get_Field(i).ToString().Replace(",", "") + ",";
sw.WriteLine(outputRow);
axRecord.Next();
}
}
Konnten Sie die Maße arbeiten? – Rod