Hi
Have problems when inserting a new record in C# code
Code:
tableHandle = cFront.OpenTable(50000);
recordHandle = cFront.AllocRecord(tableHandle);
cFront.BeginWriteTransaction();
cFront.LockTable(tableHandle, NavisionTableLockMode.LockWait);
cFront.InitRecord(tableHandle, recordHandle);
cFront.BeginWriteTransaction();
cFront.SetFieldData(tableHandle, recordHandle, 1, NavisionFieldType.Decimal, NavisionDecimal.Parse("2").GetBytes());
if (cFront.InsertRecord(tableHandle, recordHandle))
{
// if code
}
else
{
// else code
}
cFront.EndWriteTransaction();
cFront.FreeRecord(recordHandle);
cFront.CloseTable(tableHandle);
I also have a open/close connection to database
Everything works fine. I see the new record when I look in navision, but as soon as I close the database (it's ok to close record, table, company) the record disapears!
There is no errors or anything.
I have looked inte the sample application that comes with c/front but I can't seem to find anything useful.
Is there any function I have missed calling so that the records will stay?
I have also a modify/update function that works fine, even when the database is closed.
0
Comments
At least it's working now!!