Hi everybody!
I need som help for dynamics nav 5.0 sp1. i want to import invoice into Nav.
If i write into sales header table, whit this code:
try
{
NavisionFieldType type = CFrontDotNet.Instance.FieldType(table.Handle, i); // lekérjük, hogy az a mezõ amibe írni akarunk az milyen típusú
// try
// {
if (type == NavisionFieldType.Text)
{
CFrontDotNet.Instance.SetFieldData(table.Handle, recordHandle, i, type, NavisionText.Parse(elem).GetBytes());
}
else if (type == NavisionFieldType.Code)
{
CFrontDotNet.Instance.SetFieldData(table.Handle, recordHandle, i, type, NavisionCode.Parse(elem).GetBytes());
}
else if (type == NavisionFieldType.Option)
{
CFrontDotNet.Instance.SetFieldData(table.Handle, recordHandle, i, type, NavisionOption.Parse(elem, table.Handle, i).GetBytes());
}
else if (type == NavisionFieldType.Date)
{
CFrontDotNet.Instance.SetFieldData(table.Handle, recordHandle, i, type, NavisionDate.Parse(elem).GetBytes());
}
else if (type == NavisionFieldType.Decimal)
{
CFrontDotNet.Instance.SetFieldData(table.Handle, recordHandle, i, type, NavisionDecimal.Parse(elem).GetBytes());
}
else if (type == NavisionFieldType.Boolean)
{
CFrontDotNet.Instance.SetFieldData(table.Handle, recordHandle, i, type, NavisionBoolean.Parse(elem).GetBytes());
}
else if (type == NavisionFieldType.Integer)
{
CFrontDotNet.Instance.SetFieldData(table.Handle, recordHandle, i, type, NavisionInteger.Parse(elem).GetBytes());
}
// }
// catch { }
}
catch { }
the first field named “Document type” have a navisiontype: option. So i want to insert a row, all other fields inserted correctly, but this first insert a 0 value, but i send value 2.
if i run my app without “try… catch” i become a message:
The option string is not valid or exceeds the maximum number of characters allowed 250.
but i send just a string: “2”
sorry for my english and thx for the help!
Csaba