Record insertion thru C/Front

How can i create a record thru C/Front. I have written all my code in VB using C/front.ocx the following is the code i have written for writing a record into a table scandata = cf.opentable(cf.tableno(“scan data”)) scanrec = cf.allocrec(scandata) cf.bwt call cf.initrec(scandata,scanrec) call cf.assignfield(scandata,scanrec,cf.fieldno(scandata,“Info”),“testing”) cf.insertrec(scandata,scanrec) cf.ewt cf.closerec(scanrec) cf.closetable(scandata) but when i execute this code i get an error message saying type mismatch I am using Navision server 3.10A for this. Any help will be highly appreciated.

Hi Jagjeet, Is your field type is CODE? If yes then assign the value like Field = FieldVale + CHAR(0)

Hi rajesh, I have tried the suggesion you have given but still getting the same error message. what strange to me is that if you look in to the definition of the assignfield it has four parameters list 1. handle to table of type long 2. handle to record of type long 3. field no. of type long 4. field data for the parameter field data there is no type is defined. And i m thinking that the error might be in that we have to pass the pointer over there not the value. Jag

I Got IT !!! Actually the record pointer which i have declaring was at wrong position. Its working now… Thx guys for ur help