Insert record into Navision 3.7 through C/Front

Hi All I am using VS .Net version of C/Front (Interop.netCFRONT2_Prj) downloaded from http://www.mibuso.com/forum/viewtopic.php?t=1785&highlight=cfront+c My c# codes are: cf1.InitializeCFRONT(); cf1.ConnectServerAndOpenDatabase(“NDBCN”, “testdb”, “tcp”, “C:\DP Tech\Projects\Developement\Testing DB.fdb”, 10000, true, false, “sa”, “sa”); cf1.OpenCompany(“Testing”); tab18 = cf1.OpenTableByID(18); rec18 = cf1.AllocRec(tab18); temp1 = cf1.FindRec(tab18, rec18, “+”); cf1.SetFilter(tab18, “No.”, “= A-10000”); cf1.AllowRecordNotFound(); cf1.SetStopOnAllExceptions(false); if (cf1.FindRec(tab18, rec18, “-”).ToString() == “True”) { //Modify Customer Data MessageBox.Show(“Found”); } else { //Add Customer Data MessageBox.Show(“Not Found”); cf1.InitRec(tab18, rec18); cf1.AssignField_AsText(tab18, rec18, “No.”, “A-10000”); cf1.AssignField_AsText(tab18, rec18, “Name”, “Testing”); cf1.InsertRec(tab18, rec18); } And the error I got was something about cannot make changes in the database using this trigger. Has anyone done this before? And what seems to be the problem? Thanks Lawrence

Try wrapping the insert in a transaction.