|
Re: FW: thanks: msg#00055cms.cold-fusion.user.azcfug
Are you getting an error on the update, or does the script seem to run but the db value simply doesn't change from No to Yes? Assuming the former, let us know the error you're getting. Assuming the latter, can you confirm that the code is meeting the <CFIF IsDefined("assign")> condition? Test by adding <h1>Hey YOU!</h1> within the condition, just above the update statement. If so, then you know it's running the conditional code (the update) but for some reason the update is not updating. If you don't even see Hey YOU!, it ain't even tryin'; there's some reason it's not meeting the condition. I looked at your code and I don't see anything obviously wrong. Both of your methods should work. And you can definitely do an insert and an update on the same page/with the same form, as long as you define your tables and fields properly. I generally stay away from CFINSERT and CFUPDATE and run strict SQL code within a <cfquery>, because I can define everything and because I'm never sure what CF/Allaire vagaries might get in the way. But that's a more a style thing; CFUPDATE does work reliably. In desperation... - Try setting the value of Assign to "1" instead of "Yes" - Make sure Assign is being passed as a true formfield...as part of the URL it may not work, though I would think CF would throw an error. - Erase the CFUPDATE and do a <cfquery> and manually update with SQL. ---Judd --- dwiese@xxxxxxxxxxxxx wrote: > > I agree that the new field in the REQUEST table is the best way to > go. I > am having a problem getting the variable to update that new field, I > called > ASSIGN. > > My form for making the assignments, inserts a new record, made up of > data > queried from the REQUEST table and INPUT from a form. I pass those > parameters off to a new cfm to INSERT into a table called STATUS, > where > or how do I get a variable to pass to the REQUEST table to UPDATE the > field > ASSIGN with the value YES. My question is how can I INSERT into one > table > and UPDATE another from the same form or can I? I have tried just > passing > the variable to the cfm with: > > <FORM ACTION="addnew.cfm?Assign=YES" METHOD="POST"> > > That doesn't seem to work. I even tried: > > <FORM ACTION="addnew.cfm" METHOD="POST"><INPUT type="hidden" > name="ASSIGN" value="YES"> > > That didn't seem to work either. > > This is the statement I used in addnew.cfm for insert and update: > > <CFINSERT > DATASOURCE="Survey Status" > TABLENAME="status" > FORMFIELDS="Receiver, Received, Requestor, CostCode, ProjectNo, > GrpNo, T, N, R, E, ProjectName, Specials, Assignments, > SupAssignments, Surveyor"> > > <CFIF IsDefined("assign")> > <CFUPDATE DATASOURCE="Survey Status" > TABLENAME="request" FORMFIELDS="Assign"> > </CFIF> > > __________________________________________________ Do You Yahoo!? Get Yahoo! Mail ? Free email you can access from anywhere! http://mail.yahoo.com/ |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: FW: thanks: 00055, Sean Tierney |
|---|---|
| Next by Date: | The Problems with JSP: 00055, Terence Chang |
| Previous by Thread: | RE: FW: thanksi: 00055, Sean Tierney |
| Next by Thread: | Handling Requests And Statuses (Was "Re: Fw: Thanks"): 00055, Judd M. Miller |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |