0 Replies Latest reply: Nov 7, 2011 6:17 PM by Phinehas1234 RSS

    Call cffunction in cfc file

    Phinehas1234 Community Member

      Hi,

       

      I have a cfm file and cfc file and want to implement some checking function in cfc file like following:

       

      In cfm file, I use javascript to call cfc function where result is a cfdiv tag in cfm file:

       

      1) ColdFusion.navigate( 'cfc/control.cfc?method=checkRecord','result' );

       

      Then, it runs cfc file:

      2) call "checkRecord" and show confimation box using JavaScript some similar records are found.

      var proceedAdd = confirm('#message#');

       

      3) if clicks OK, it calls next addRecord to add new record to database.

      if (processAdd == true)

      ColdFusion.navigate( 'cfc/control.cfc?method=addRecord','result' );

       

      4) show a dialog for "record added" message.

       

       

      Although it is my logic, I encounter some problems in step 3. It shows me an error on ColdFusion.navigate( 'cfc/control.cfc?method=addRecord','result' );

      And I think I cannot call the cffunction within cfc. How can I solve this problem?