This is a coding in visual basic by using c/front library. The objective of my code is 1.retrived data from customer table (It’s work) 2.call a function in codeunit. It doesn’t work. Set a = CreateObject(“cfront.cfrontctrl.1”) a.LoadLicenseFile “c:\Program files\Navision Attain\Client\fin.flf” Call a.ConnectServerAndOpenDatabase(“NDBCS”, “Bkknavsql”, “tcp”, “TestW1”, 0, 0, 1, “”, “”) a.OpenCompany “INTERCONTINENTALJEWELL” a.OpenTable tCustomer, 18 rCustomer = a.AllocRec(tCustomer) a.UseCodeUnitsPermissions (52013) 'a.52013.run ---- I got compile error when I try to call function in codeunit [V] ??? Does anyone know how to call a function in this codeunit by using C/Front? I want to get the return value from the codeunit for doing web base. counter = a.RecCount(tCustomer) tmpVar = a.FindRec(tCustomer, rCustomer, “-”) MsgBox tmpVar If VarType(tmpVar) = vbBoolean Then MsgBox “FindRec OK” Else MsgBox “FindRec failed. It didn’t return a boolean” End If tmpLastRecord1 = a.GetFieldData(tCustomer, rCustomer, 1) tmpLastRecord2 = a.GetFieldData(tCustomer, rCustomer, 2) MsgBox tmpLastRecord1 MsgBox tmpLastRecord2 a.FreeRec tCustomer a.CloseCompany a.CloseDatabase
You can’t call C/AL codeunit from CFront. Cfront only covers data layer.
What is the best solution? I need to call it from outside of Navision and The code unit that I want to call It’s very complicate.I can’t write it again.I heard a lot of people talk about NAS but I don’t know how to make It works.Please make me clear more.
- NAS. check http://www.mibuso.com/dlinfo.asp?FileID=171 2. Write cf application, which writes data to table, and allways running Navision application (C/AL side) checks that table …
Hi Dalius I did try to read your document about Navision Application Server.But I can’t understand it .Could you please send me an example coding ? I really need it.Please help Thank in advance Nan