how to call OnValidate using CFront

How can i call onValidate of a database field while i try to enter a data through a VB interface using C/Front . I mean the data gets saved but does not call the onValidate part of it bcoz of which i fear i will have to re write a lot of bussiness logic thats already in Navision in my VB interface so that correct values get saved in the Databse…[:(][:(] Plz help ASAP. How do i call onValidate of a field in am trying to save from a VB interface using c/front I know there are many experienced guys who can help me out or atleast provide me an alternative to it. Then plz doooooooo… help me. Thanx Sanjeev

Hi Pandita, It is impossible to call the triggers from C/Front (or from C/ODBC). The only way to call triggers from outside, is to use NAS. Best Regards, Karl

Hi Kadler, Thanx for ur kind co-operation Does this essentially mean that i will have to re write the entire logic of validations and certain algorithims that get called on the onValidate() trigger into my VB Interface. Can you please, also suggest me, as to how do we call them using NAS. some idea,examples,documents or help so that i get a better understanding of it Thanking you Pandita

Hi Dear, I would suggest that Using CFRONT you save the data in a different temp table and using a codeunit you transfer that data from the temp table to origional table and use Validate method. Please explain me ur requirement in more detail to give you a better suggestion.

Hi Mukesh, Thanx for ur time and effort. Say for example i want to make a Sales Order Form in VB, now as in the sales line table below in Navision i draw a similar table in VB with all the basic needed relevant fields, in Navision as soon as i enter an Item COde or the Quantity the Price algorithim fires by itself and provides me with an appropriate ITEM Price and even checks up with the Quantity in Inventory. To do this in VB do i need to to write the complete price logic if no then how do i use that of navision and if yes then god help me because i will have to then re write a lot of logic already there in navision onto my VB interface. Actually how can i Call codeunits from CFRONT. And if at all i save data in the Temp table then how do i call a codeunit to transfer the data from temp to original using CFRONT. Plz help me with an idea of using codeunit from CFRONT coz if that is done then i suppose most of my problem is done with regards Pandita

You can’t execute Navision triggers with C/Front. You can try 3 things: 1. create temporary table. Fill it with CFRONT and with a Navision timer update the required fields and validate it. 2. Drop CFRONT. Create an ActiveX DLL (easily done in VB6) and define triggers in it and program your interfacing in it. Create instance to OCX on a Navision form and set “withevents” property to “yes”. In the triggers that are added to the form, parse the new value and call the Navision validation routines. 3. I believe NAS has capabilities as well to validate. For 1 en 2 you have to be aware that this does not suppress the standard Navision user interface and you will need a navision client running when your VB application is running. If an error occurs a message will popup. You will have to program validation routines so they won’t interact with the user (I assume you create an automated process).

Hi Dear, You can not fire OnValidate trigger or run the Codeunit using c/front. We can run the codeunit from the navision interface. Your requirement can not be fulfilled using c/front. You will have to write the code in VB only. It seems as you want to emulate the Navision Client. I would suggest that you create an Active X DLL to run the Sales Order Form[Creted in VB] with trigger and then use it in Navision. Regards, Mukesh Verma