Great Ideas. Always Flowing.

We are not happy until you are happy. Client satisfaction guaranteed. Whatever your needs and requirements, we have the skills and resources for the job!

Quick login...


Or... now make it easy with Facebook Integration
Connect via Facebook



Top Sellers

Frustrated over the lack of customization for your user's registration fields? Dynamically setup your DNN Portal with custom registration fields, layout, questions, and other core integration options......

Ultra Video Gallery is a brother product of Ultra Media Gallery, UVG allows you to upload videos in various format and automatically encode them to flv or H264 format, you also can add videos from internet or record live videos from your webcam.

Build high performance, completely customizable data-entry forms and views driven by your DNN and external databases. New built-in tools make it a snap to quickly create data entry forms, data views, and even database tables. Plus, add your own HTML, CSS, Javascript, SQL commands, stored procedures,

The most advanced DotNetNuke shopping cart on the planet. Easy to use e-Commerce, Secure Shopping Cart Software and SEO friendly. B2C / B2B Ecommerce Sites.

One stop solution for events calendar and events registration! FREE DOWNLOAD is available now!

Action SQL
Last Post 10-07-2010 08:26 AM by Ryan Bakerink. 7 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
xcalx9User is Offline
skipping stones
skipping stones
Posts:5
Avatar

--
09-27-2010 11:00 AM
    I'm trialing Dyn Views 2.0. I've set up an action link to display for each returned row of data. I'd like the action to update one of the outputed fields in that specific row. I'm trying to figure out what the proper syntax is to reference a cell in my sql query.

    Update mytable Set mycolumn1 = 'newstatus' Where mycolumn2 = $(DynViewsMyColumn2Instance)

    In other words - are "tokens" or column instances able to be referenced in the action SQL? Trying to figure out what I would use in place of $(DynViewsMyColumn2Instance). Is it $$'s, [ ] s, etc
    xcalx9User is Offline
    skipping stones
    skipping stones
    Posts:5
    Avatar

    --
    09-29-2010 05:07 AM
    Maybe that was too complicated. Can someone just provide an example of the Action event SQL to update that specific row of Dyn Views output?
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    09-29-2010 11:17 AM
    Hello Xcalx9,

    I wouldn't really see the reason for your interest in updating a record using an Action. After all writing a SQL query to update a record if clicked seems unpractical but then again I don't know the specifics of what you're trying to accomplish.

    But in the scenario I think that would better fit your needs is to place a anchor tag/hyperlink into your template and pass querystring variables to a page with Dynamic Forms where it's only purpose is to pull in data and edit the record.

    The Dynamic Form will then use SQL binding based on a querystring parameter that you passed.

    The Dynamic Views querystring will have something like DSParam1=$(UniqueCompletionID)

    Make sure you have a hidden field that collects via querystring specifically the uniqueIdentifier.

    Then In the SQL binding use in your where clause WHERE uniqueCompletionID ='$DSParam1' or some sorts. Make sure you remove the single quotes and replace with tick marks or the query will fail.

    How is your Dynamic View getting its data source? Custom SQL query, Dynamic Forms Instance or a table name?

    When you generate columns make sure there's a unique column(primary key) that you can identify a specific record.


    If you have any questions please let me know.

    Thanks,

    Ryan
    xcalx9User is Offline
    skipping stones
    skipping stones
    Posts:5
    Avatar

    --
    09-30-2010 05:03 AM
    Thanks, Ryan. I did get a chance to play with dyn forms and understand that could work as a solution.

    I guess I was interested in Dyn Views feature listed on the snowcovered page:

    "New Action section in Module Configuration allows you to create commands and functionality by building unique SQL actions against your records to manipulate the data.  Your action token can be an image button or a link button.  Want to add a "Delete This Record" button to your template?  How about mark this record as "Paid" or add a role?  This is where you set it up!"

    My purpose is actually identical to this, where I just would want a button next to each row where by clicking it a staff person would update a record to "paid". But I can't seem to figure out how to refer to that specific row of data the button is next to. I would have thought there was either a built in functionality or a token to do this (to refer to the primary key), otherwise what would be the point of an "action" button being displayed next to each row? My primary key of the table is "invoicenum" - and is also marked as primary key in the Dyn Views configuration section.

    My table is a custom sql generated table - but could also be just a "table" view since it is really just 1 flat table.



    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    09-30-2010 07:13 AM
    Hello Xcalx,

    In this case you can use an action simply by using an update statement in your Action SQL Query.

    Something like this will go into your Action SQL Query:

    UPDATE yourFlatTable SET columnPaid='True' where uniqueCompletionID= '$(PrimaryKey)'

    Now this is obviously not going to be a query that works simply because this information doesn't exist.

    But this is basically the syntax.

    If you have any questions please let me know.

    Thanks,

    Ryan
    xcalx9User is Offline
    skipping stones
    skipping stones
    Posts:5
    Avatar

    --
    09-30-2010 09:03 AM
    Thanks, Ryan. Yea that was my first attempt:

    UPDATE MyInvoices
    SET PaidStatus = 'Paid' where InvoiceNumber = '$(InvoiceNumber)'

    For some reason it doesn't recognize the token. It works ok if I hard code in the invoice number in place of the token. I double checked that InvoiceNumber is my column name in the Dyn Views config as well as my actual table. Thought maybe I had the token syntax wrong.
    xcalx9User is Offline
    skipping stones
    skipping stones
    Posts:5
    Avatar

    --
    09-30-2010 12:41 PM
    I got it to work. I didn't realize to literally use the word PrimaryKey in my SQL query. I was using the name of the field which was my primary key. Thanks.
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    10-07-2010 08:26 AM
    Hello xclax9,

    I'm glad to see that you've found the solution to your issue.

    Also we have the Dynamic Views updated User Guide that accounts for all of the newly added features in Dynamic Views 2.0.

    Please use this link:

    http://www.datasprings.comuserguide...rGuide.pdf

    If you ever have any questions please let us know.

    Thanks,

    Ryan
    You are not authorized to post a reply.


     
     

    Join our mailing list...

    Get current news and events the easy way
    Subscribe Me

    Recent Blogs...

     
    Copyright 2005 - 2011 by Data Springs, Inc.
     
  • film izle
  • 720 izle
  • film
  • sinema izle
  • film makinesi
  • T�rk�e dublaj film
  • film izle
  • film izle
  • baglan film izle
  • sinema izle
  • 1080 film izle
  • film mercegi