Hi Martin,
Thanks for your prompt reply and suggestion.
I have debug my code in visual stuido and found the exact line on which it gives an error.
I am using Sys Operation Framework and expose this class as a service and consuming from C# console application.
It is a standard Data Export import class.
\Classes\SysDataExportBase\exportSCscSupertypes
protected Integer exportSCscSupertypes(tableId _tableId)
{
counter recCount = 0;
List subtypes;
ListEnumerator le;
SysQueryRun sqr;
SysDictTable thisTable;
boolean isFirst = true;
// export subtypes
if ( tableId2SubtypeListMap.exists(_tableId) )
{
subtypes = tableId2SubtypeListMap.lookup(_tableId); //Getting error on this line
**//**System.InvalidCastException was unhandled by user code
Message: An exception of type ‘System.InvalidCastException’ occurred in Dynamics.Ax.Application.dll193.netmodule but was not handled in user code
Additional information: Unable to cast object of type ‘Microsoft.Dynamics.Ax.Xpp.Set’ to type ‘Microsoft.Dynamics.Ax.Xpp.List’.
le = subtypes.getEnumerator();
while(le.moveNext())
{
if ( !this.getTableExported(le.current()) )
{
this.exportSCscSupertypes(le.current());
}
}
}
// export records associated with subtypes
if ( tableId2SubtypeListMap.exists(_tableId) )
{
thisTable = new SysDictTable(_tableId);
subtypes = tableId2SubtypeListMap.lookup(_tableId);
le = subtypes.getEnumerator();
while(le.moveNext())
{
sqr = this.createSCscQueryRun(_tableId,le.current(),false);
if ( sqr!=null )
{
recCount += this.exportTable(thisTable,null,sqr,!isFirst);
isFirst = false;
}
}
this.setExportedRecCount(_tableId,recCount);
}
return recCount;
}
Can you suggest some solution for this?
Regards,
Janak Talekar