R2i DotNetNuke® Forum

R2i wants you to have the opportunity to ask questions, post reviews, help others or just rant and rave about DotNetNuke® or any of the R2i Modules and Skins. Our team spends hour upon hour, day after day, working on custom DotNetNuke® modules and services; please feel free to ask us anything.
 
Help a newbie with Update
Last Post 15 Sep 2006 12:36 PM by lloydcarroll. 3 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Informative
LenLatimerUser is Offline
New Member
New Member
Posts:15

--
25 Jul 2008 04:36 AM  
I have a form that retrieves one record. When I change the data and then click the Save Command, and the message triggers a SQL update event, using a Where statement matching [userID] or [SubID] (both in the original Query), all records are updated instead of just the one. I thought the [variables] syntax refered only to result variables. On the other hand, if I use @fmrSubID as a match in the Where statement (it's displayed on the form and visible under variables), nothing gets updated.

I'm sure it's something simple I don't see. Thanks.

Updates all:
UPDATE Lynx_sub
SET
VacationEndDate=@frmVacationEndDate, VacationStartDate=@frmVacationStartDate
WHERE SubID=[SubID]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Updates none

UPDATE Lynx_sub
SET
VacationEndDate=@frmVacationEndDate, VacationStartDate=@frmVacationStartDate
WHERE SubID=@frmSubID
pmandaUser is Offline
Basic Member
Basic Member
Posts:268

--
25 Jul 2008 03:04 PM  
You can pass in the message Action [SubID] value.

{Action,[SubID],Save,,Message}

In the xy variables you can declare a variable by selecting "Message" in the dropdown and Source "Save" and Target @Save.

In the Message actions query

UPDATE Lynx_sub
SET
VacationEndDate=@frmVacationEndDate, VacationStartDate=@frmVacationStartDate
WHERE SubID=@Save


Hope this solves your problem.

Praveena Manda<br>Software Engineer<br>Bi4ce,Inc
LenLatimerUser is Offline
New Member
New Member
Posts:15

--
25 Jul 2008 05:53 PM  
My results is that I get no update. Here are the settings:

the save button:
<A class=CommandButton {ACTION,[SubID],Save,,Message}>Save
</A> | 

Under y=x I have

<Message> Save @Save

Under Action I have 2 actions:
1)
Message: Awaiting incoming message with Type '' and Value 'Save'.
2)
# Execute Query[Update]: UPDATE Lynx_sub SET VacationEndDate=@frmVacationEndDate, VacationStartDate=@frmVacationStartDate WHERE SubID=@Save

I get no update to the table.
Is there any way to debug and see the action query result like you can on the main query?
wlevyUser is Offline
New Member
New Member
Posts:66

--
27 Jul 2008 07:37 PM  
For your Message listener (Item 1 in your list of Actions), I believe you want to specify Type=Save, and leave Value blank (it will hold the SubID you specified in the anchor).
You are not authorized to post a reply.

Active Forums 4.1
 

New York, NY • Baltimore, MD • Vienna, VA • St. Louis, MO • Seatle, WA • 410.327.0007 • info@R2Integrated.com

Bookmark & Share Bookmark and Share