Hello Brett,
The answer is yes.
Dynamic Form Question Addition #1:
You'll need to add another Question of type Hidden field to your Dynamic Form. Lets give it a shortname of "DSParam1". Make sure this Hidden field has Retrieve from Querystring enabled.
Dynamic Form Question Addition #2:
You'll need to add a Question of type Hidden field to your Dynamic Form. Lets give it a shortname of "DBUpdate". Give this hidden field a Default Hardcoded value to "False". Make sure this Hidden field has Retrieve from Querystring enabled.
Dynamic Form Question Event #1:
Then you'll want to build an INSERT SQL COMPLETION EVENT, which sounds like you already have. However this will only fire when DBUpdate = False
Dynamic Form Question Event #2:
Add a SQL COMPLETION EVENT to handle the Update of a record on your Dynamic Form. This will only fire when DBUpdate = True.
NOW FOR THE DYNAMIC VIEW SECTION:
You need to pay attention to what the Primary key is for your custom SQL table. In this example it will be "ResultID".
Add a hyperlink into your Dynamic View template with the HREF set to the URL to the Dynamic Form page.
Let's say this is where your Dynamic Form is located:
www.yoursite.com/DynamicForm
This is what the Edit hyperlink path would look like(Replace "[" and "]" with "<" and ">"):
[a href="www.yoursite.com/DynamicForm?DSParam1=[resultid]&DBUpdate=True"]EDIT RECORD[/a]
The whole idea is to get the Dynamic Form to act differently depending on different conditions. So it's sort of like you'll have an INSERT and an UPDATE mode.
INSERT mode is depicted by DBUpdate = False
UPDATE mode is depicted by DBUpdate = True
Now for the fun part on the Dynamic Form. You'll need to go to Module Configuration -> Advanced Coding Options -> Initial SQL Rendering / Bind
* Enable this feature.
* Make this fire only when DBUpdate is present as a Querystring in the URL.
Build your SQL Query to return only 1 record, if your SQL table is named "SQLTable" then please build a similar query:
Select * from SQLTable where ResultID = '$(DSParam1)'
NOTE: The column named returned from SQLTable need to match up exactly with questions on your Dynamic Form in order to successfully map column data from your table to your Dynamic Form.
If you need more information on this functionality. Please review Demonstration 31:
http://www.datasprings.com/formdemos Thanks,
Ryan