I get the following error when I change something in the grid and submit:

 Primary key not found for the "STEP_1" table.  The table you are attempting
to UPDATE (STEP_1) does not have a primary key (a field or set of fields
which uniquely identify each record).   The error occurred in
*C:\CFusionMX7\wwwroot\WCF_NOR_Admin\test2.cfm:
line 3*

1 :
2 : <cfif IsDefined("form.gridEntered")>
*3 :    <cfgridupdate grid="step1Grid"*
4 :             datasource="WCF_PROD"
5 :             tablename="STEP_1"




This is my code:


<cfif IsDefined("form.gridEntered")>
<cfgridupdate grid="step1Grid"
datasource="WCF_PROD"
tablename="STEP_1"
keyonly="yes">
</cfif>

<!--- Query the database to fill up the grid. --->
<cfquery name="getStep1Data" datasource="wcf_prod">
select ACCOUNTING_FY,
SOURCE_COST_CENTER,
DESTINATION_COST_CENTER
from WCF.STEP_1
</cfquery>

<cfform format="flash" method="post">

<cfgrid name="step1Grid" query="getStep1Data"
rowheaders="false" insert="yes" insertbutton="Insert New Record"
delete="yes" deletebutton="Delete Record"
selectmode="edit">
<cfgridcolumn name="ACCOUNTING_FY" header="Acctg FY">
<cfgridcolumn name="SOURCE_COST_CENTER" header="Source Cost Center">
<cfgridcolumn name="DESTINATION_COST_CENTER" header="Destination Cost
Center">
</cfgrid>

<cfinput type="text" name="accounting_fy" label="Acounting Fiscal Year"
bind="{step1Grid.dataProvider[step1Grid.selectedIndex]['ACCOUNTING_FY']}"
onChange="step1Grid.dataProvider.editField(step1Grid.selectedIndex,
'ACCOUNTING_FY', accounting_fy.text);">

<cfinput type="text" name="source_cost_center" label="Source Cost Center"
bind="{step1Grid.dataProvider[step1Grid.selectedIndex
]['SOURCE_COST_CENTER']}"
onChange="step1Grid.dataProvider.editField(step1Grid.selectedIndex,
'SOURCE_COST_CENTER', source_cost_center.text);">

<cfinput type="text" name="destination_cost_center" label="Destination Cost
Center"
bind="{step1Grid.dataProvider[step1Grid.selectedIndex
]['DESTINATION_COST_CENTER']}"
onChange="step1Grid.dataProvider.editField(step1Grid.selectedIndex,
'DESTINATION_COST_CENTER', destination_cost_center.text);">

<cfinput type="submit" name="gridEntered" value="submit" >

</cfform>
I have a primary key on the table that consists of all 3 columns.

I figure that it's something rather simple but I can't get it working.
Thanks for your time and assistance in advance.

--
Chris Tilley


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:220023
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to