Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9274577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:23:11+00:00 2026-06-18T16:23:11+00:00

I have a .cfm and .cfc that I am using to edit data in

  • 0

I have a .cfm and .cfc that I am using to edit data in a cfgrid on the .cfm, and it works, however 10% of the time I will get the following error message:

“Error invoking CFC /test/editCFgrid.cfc: Internal Server Error“

I tried using the debugging advice, however no luck.

Here is the CFM code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<cfform name="artistform">
            <cfgrid format="html" name="artistgrid" pagesize=11
            striperows="yes" 
            bind="cfc:editCFgrid.getArtists({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection})"
            delete="yes" insert="yes" selectmode="edit"
            onchange="cfc:editCFgrid.saveArtist({cfgridaction},{cfgridrow},{cfgridchanged})">
                <cfgridcolumn name="firstname" header="First Name" />
                <cfgridcolumn name="lastname" header="Last Name" />
                <cfgridcolumn name="address" header="Address" />
                <cfgridcolumn name="city" header="City" />
                <cfgridcolumn name="state" header="State" />
                <cfgridcolumn name="postalcode" header="Postal Code" />
                <cfgridcolumn name="email" header="Email" />
                <cfgridcolumn name="phone" header="Phone" />
                <cfgridcolumn name="fax" header="Fax" />
                <cfgridcolumn name="thepassword" header="Password" />
</cfgrid>
</cfform>
</body>
</html>

Here is the CFC code:

<cfcomponent output="FALSE">
    <cffunction name="getArtists" hint="I extract artists from the database" access="remote" output="FALSE" returntype="struct">
        <cfargument name="page" required="TRUE" hint="the page the grid is on" />
        <cfargument name="pagesize" required="TRUE" hint="records displayed per page" />
        <cfargument name="gridsortcolumn" required="TRUE" hint="selected column to sort" />
        <cfargument name="gridsortdirection" required="TRUE" hint="the sort direction" />
        <cfset var qArtists = "" />

        <cfif arguments.gridsortcolumn eq "">
            <cfset arguments.gridsortcolumn = "lastname" />
            <cfset arguments.gridsortdirection = "asc" />
        </cfif>

            <cfquery name="qArtists" datasource="test_database">
                SELECT *
                FROM Artists
                ORDER BY #arguments.gridsortcolumn# #arguments.gridsortdirection#
            </cfquery>

        <cfreturn QueryConvertForGrid( qArtists, arguments.page, arguments.pagesize ) />
    </cffunction>

    <cffunction name="saveArtist" type="any" hint="I insert, update or delete an artist" access="remote" output="FALSE" returntype="void">
        <cfargument name="gridaction" type="any" required="TRUE" hint="I for insert, U for update and D for delete" />
        <cfargument name="gridrow" type="any" required="TRUE" hint="the rows being inserted or updated" />
        <cfargument name="gridchanged" type="any" hint="the changes" />
        <cfset var qInsertArtist = "" />
        <cfset var qUpdateArtist = "" />
        <cfset var qDeleteArtist = "" />

        <cfif IsStruct( arguments.gridrow ) and IsStruct( arguments.gridchanged )>
            <cfif arguments.gridaction eq "I">
                <cfquery name="qInsertArtist" datasource="test_database">
                    INSERT INTO Artists
                        (firstname, lastname, address, city, state, postalcode, email, phone, fax, thepassword)
                    VALUES
                        (<cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.gridrow.firstname#" />, 
                        <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.gridrow.lastname#" />, 
                        <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.gridrow.address#" />, 
                        <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.gridrow.city#" />, 
                        <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.gridrow.state#" />, 
                        <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.gridrow.postalcode#" />, 
                        <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.gridrow.email#" />, 
                        <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.gridrow.phone#" />, 
                        <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.gridrow.fax#" />, 
                        <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.gridrow.thepassword#" />)
                </cfquery>

            <cfelseif arguments.gridaction eq "U">
                <cfset var colname = StructKeyList( arguments.gridchanged ) />
                <cfset var value = StructFind( arguments.gridchanged, colname ) />
                    <cfquery name="qUpdateArtist" datasource="test_database">
                        UPDATE Artists
                        SET #colname# = <cfqueryparam value="#value#" />
                        WHERE artistid = <cfqueryparam cfsqltype="cf_sql_integer" value="#arguments.gridrow.artistid#" />
                    </cfquery>

            <cfelseif arguments.gridaction eq "D">
                <cfquery name="qDeleteArtist" datasource="test_database">
                DELETE FROM Artists 
                WHERE artistid = <cfqueryparam cfsqltype="cf_sql_integer" value="#arguments.gridrow.artistid#" />
                </cfquery>
            </cfif>
        </cfif>
    </cffunction>
</cfcomponent>

Each function (edit, insert, delete, etc) works, but it randomly will generate the error. Ultimately, I am seeking a code that will ignore/block/”OK” the error message so the user won’t see it.

Any help will be greatly appreciated! I have spent the entire day (9 hours) googling for an answer, but I haven’t found any. I do not have access to the CF Admin Log, I’m just a regular developer. Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T16:23:12+00:00Added an answer on June 18, 2026 at 4:23 pm

    There is a way to ignore/block/ok the “error” message with the following script:

    <script>ColdFusion.setGlobalErrorHandler(function (error) 
    {mygrid = ColdFusion.Grid.refresh ('artistgrid', false);
    }
    );
    </script>
    

    Insert this script in the CFM files, and you’re good to go! Being that the error that I was encountering was not impacting the function (editing the cells) of the cfgrid (the pop-up message was being more of a nuisance then anything else). Hopefully this solution will help others!

    You do not need to use the ‘Grid.refresh’ command in the script, you can use anything command you want.

    Thanks everyone who attempted to answer my issue!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I have a folder structure that looks like this: / /bin/myComponent.cfc /reports/index.cfm How
I have a Function in CFC file, which will be called from .cfm file
I have the following RewriteRule: RewriteRule ^/people/([A-Za-z0-9\-\_]*)/?$ /people/people_details.cfm?person=$1 [I,L] ...it works great for forwarding
I have an issue with CF9 ORM mapping. I get the following error from
I have the following $.ajax({ type: POST, url: qry_invControl.cfm, data: p_sales_price= + input.val() +
I am using ColdFusion 9.1.2. I have a CFC called orders.cfm. This is the
I have the following jQuery get: $.get(rssread.cfm?number=10, function (d) { $('#feedContent').append($(d).html()); }); The get
I have an error page, anyError.cfm , that looks like this <!DOCTYPE html> <html>
I have the following in a ColdFusion page that pulls in some data for
I am using ColdFusion 9.0.1. I have a new web site that uses Bikes.cfm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.