isaks
going with the flow Posts:60
|
09-29-2010 07:16 AM |
|
Hello,
first i have to say that i like DynamicsForms very much.
My question is:
It is possible to get DynamicForms_ResultsID in second form and work with this id as the identifier or is there a way to have an "UPDATE" button right next to the "SUBMIT" button and also the "DELETE" button in the same form?
I read a lot postings an all you tutorials but can´t find the necessary answer for my problem.
in the following post:
http://www.datasprings.com/Products/SharePoint-Web-Parts/Sharepoint-Forums/tabid/777/forumid/5/tpage/2/view/Topic/postid/13456/Default.aspx
you can read:
"Okay, never mind this will not work after looking at your SQL INSERT STATEMENT. You have the column DynamicForms_ResultsID as an auto-identifier so it gets generated by increment of 1. Hence, there's no way to use client side javascript to set DSParam1 to equal to it since the value gets written after form submit (SQL completion event to insert).
However, this is not necessary anyways."
Every tutorial shows the way to update and delete with indoo or with dnn-reports but not how to create the UPDATE" "SUBMIT" and "DELETE" button in the same form.
thanks, Richard |
|
www.isaks.com
Desktopsearch and DMS for free.
Germany |
|
|
Ryan Bakerink
river guide Posts:1900
|
09-29-2010 10:23 AM |
|
Hello Isaks,
Here's a great work flow to have an add, edit and delete functionality.
Have 2 pages. 1 page with a Dynamic Forms that will handle adding a new record, and the other page that will handle editing a record.
Have 1 Dynamic View or OWS on another page.
With Dynamic Views you can use hyperlinks in your template which you can pass querystring variables along on the link. So you could make a hyperlink that when clicked will be redirected to your page with a Dynamic Form for editing, but with the URL you will pass querystring variables will the URL. All of the fields on your Edit Dynamic Form will retrieve from querystring variable and use SQL data binding based on a querystring parameter. Lets say DSParam1. DSParam1 will equal the uniqueCompletionID that is on the Dynamic View(the specific record that you clicked the hyperlink).
This takes care of your edit.
Your Dynamic View will retrieve it's source from Dynamic Forms Instance, your add form. Generate Columns and now you have edit and add taken care of.
The delete is the easiest. You can use the Dynamic View for deleting. Use an Action with the SQL query that will delete based on your $(PrimaryKey).
This sums up the work flow of having an insert, edit, and delete.
I know this is general and not very specific as step by step instructions, but I simply can't take the time to write step by step instructions.
I hope you can get this functionality to work for you.
If you have any questions please let me know.
Thanks,
Ryan |
|
|
|
|
isaks
going with the flow Posts:60
|
10-05-2010 10:27 PM |
|
Hello Ryan, thank you for your answer. I take a little time, cause i was on holiday. In my understanding, there is no way to do that, without third-party supplier tools like DynamicViews. i will try it like you said. thanks, Richard |
|
www.isaks.com
Desktopsearch and DMS for free.
Germany |
|
|
isaks
going with the flow Posts:60
|
10-06-2010 10:00 AM |
|
Hello Ryan,
sorry for my "amazing" english, but i hope you´ll understand.
I tried it hours and hours but the result is, i can´t get the right data for an update in Form2.
As you described, with Dynamic Views i can use hyperlinks in my template which can pass querystring variables along on the link. that will work like http://localhost/Form1.aspx?DSParam...DSParam1)'
But my Question or my whish is to transfer data from Form1 to Form2.
Now you will say, what about Parameter "Pass values of this question to session variable:"? Yes, i can pass the value "UniqueCompletionID" between Form1 and Form2. But open with databind like http://localhost/Form1.aspx?UniqueC...letionID)' will not work.
The '$(UniqueCompletionID)' should be passed as "DSParam1" but did not work.
The following Link desribe exactly my problem and my experiences:
http://www.datasprings.com/Products...fault.aspx
thanks, Richard |
|
www.isaks.com
Desktopsearch and DMS for free.
Germany |
|
|
Ryan Bakerink
river guide Posts:1900
|
10-06-2010 02:13 PM |
|
Hello Isaks,
Can you try changing your redirection event from:
http://localhost/Form1.aspx?UniqueC...letionID)'
To:
http://localhost/Form1.aspx?DSParam1='$(UniqueCompletionID)'
Your SQL bind will use the querystring variable DSParam1 like so:
select * from tableName where uniqueCompletionID = '$(DSParam1)'
Note: Make sure all of your question fields have the same shortfieldname as the columns from the table your pulling in.
Please let me know if this helps you.
Thanks,
Ryan |
|
|
|
|
isaks
going with the flow Posts:60
|
10-06-2010 11:40 PM |
|
Hello Ryan,
http://localhost/Form1.aspx?DSParam...letionID)' does not work.
DSParam1 is empty.
i tried it with "Pass values of this question to session variable:" or with "Pass values of this question to querystring variable:" or with "Client side event: $DSParam1=$(UniqueCompletionID). Also i tried with Custom JavaScript File/Initial JavaScript:: $(DSParam1) = $(UniqueCompletionID).
The Problem is that DSParam1 is empty all time. |
|
www.isaks.com
Desktopsearch and DMS for free.
Germany |
|
|
isaks
going with the flow Posts:60
|
10-07-2010 12:58 AM |
|
Hello Ryan,
when i change my redirection event from
Redirect Page: Page ( A Page On Your Site ) and the DSParam1 should be passed automatically, then it is not working.
DSParam1 will be still empty.
But when i redirect as you said like
http://localhost/Form2.aspx?DSParam...letionID)'
then it works:
http://localhost/Form2.aspx?DSParam1=%270172e34d-5628-49fa-b1ba-4768f0aeffed%27 &DSParam1=
but here you can see, the DSParam1, passed by System is empty. Why? |
|
www.isaks.com
Desktopsearch and DMS for free.
Germany |
|
|
Ryan Bakerink
river guide Posts:1900
|
10-07-2010 09:36 AM |
|
Hello Isaks,
Can you place a text field named uniqueCompletionID which retrieves from session and place it on the form which is using SQL databinding. See if the unique completion id is getting passed to this textbox. If so then use the UniqueCompletionID token in your sql bind:
select * from tableName where uniqueCompletionID='$(uniqueCompletionID)'
See if this will work for you.
Thanks,
Ryan |
|
|
|
|
Ryan Bakerink
river guide Posts:1900
|
10-07-2010 09:43 AM |
|
Hello Isaks,
Can you place a text field named uniqueCompletionID which retrieves from session and place it on the form which is using SQL databinding. See if the unique completion id is getting passed to this textbox. If so then use the UniqueCompletionID token in your sql bind:
select * from tableName where uniqueCompletionID='$(uniqueCompletionID)'
See if this will work for you.
Thanks,
Ryan |
|
|
|
|
isaks
going with the flow Posts:60
|
10-10-2010 05:12 AM |
|
Hello Ryan,
i will make it now with DV and DF. it seems to be more easier and it works.
Thanks,
Richard |
|
www.isaks.com
Desktopsearch and DMS for free.
Germany |
|
|
Ryan Bakerink
river guide Posts:1900
|
10-11-2010 08:15 AM |
|
Hello Richard,
I'm glad this will work for you in the time being, in the future if you ever have any questions please let me know.
Thanks,
Ryan |
|
|
|
|
Ahmed Eltawil
new to the springs Posts:2
|
04-26-2011 08:36 AM |
|
Posted By Ryan Bakerink on 09-29-2010 12:23 PM
The delete is the easiest. You can use the Dynamic View for deleting. Use an Action with the SQL query that will delete based on your $(PrimaryKey).
Can you please post the SQL needed for deleting? Is it a stored procedure that I can use? |
|
|
|
|
Ahmed Eltawil
new to the springs Posts:2
|
04-26-2011 12:41 PM |
|
For those who are looking for a similar solution:
The SQL needed to delete a single form entry from an existing Dynamic Forms module is as follows:
DELETE FROM dbo.DynamicForms_QuestionResponse WHERE (UniqueResponseID = @UniqueResponseID)
Convert it to a Stored Procedure and pass the UniqueResponseID as a parameter like this:
EXEC dbo.DeleteMyDynamicFormEntry '$(PrimaryKey)';
For example, you can add the above statement as an Action under a Dynamic Views module.
Apparently $(PrimaryKey) returns the form's UniqueResponseID, which will basically look for all question responses saved under this unique response ID (as in the Form ID) and deletes them.
I hope the above helps. v |
|
|
|
|