Comments on: SharePoint Document Generator – Part 1: How to establish a parent – child relationship in SharePoint http://www.endusersharepoint.com/2009/09/25/sharepoint-document-generator-part-1-how-to-establish-a-parent-%e2%80%93-child-relationship-in-sharepoint/ No GeekSpeak on SharePoint 2007 WSS and MOSS Mon, 28 Jun 2010 21:30:34 -0400 http://wordpress.org/?v=2.8.6 hourly 1 By: Mindaugas http://www.endusersharepoint.com/2009/09/25/sharepoint-document-generator-part-1-how-to-establish-a-parent-%e2%80%93-child-relationship-in-sharepoint/comment-page-1/#comment-20343 Mindaugas Thu, 10 Dec 2009 18:20:04 +0000 http://www.endusersharepoint.com/?p=2272#comment-20343 Hi Carlos: All steps are done in the CustomDispForm.aspx 4. You can insert ListFormWebPart by going Insert->SharePoint controls->List form ... . In the "List or Document Form" dialog choose your child list and "New item form" option. 5. Again in the same CustomDispForm.aspx just below list form web part you inserted in step 4. Select Insert->SharePoint controls->Web Part ... and select child list web part. Actually you can insert it using SharePoint user interface by editing page in the browser. 6. Right mouse click on parent list folder in SharePoint Designer. Select Properties-> Supporting Files tab. Then select correct content type and Browse for the new display item form ( CustomDispForm.aspx). Best to do it when content type for which you are setting supporting files is the default content type configured in parent list settings (using standard SharePoint user interface). 3. You must replace the default ListFormWebPart that is already there when you copied the default DispForm.aspx and renamed it to CustomDispForm.aspx. Also there is some bugs in last steps. You can find them explained in my blog over here http://www.sharepointdrive.com/blog/Lists/Posts/Post.aspx?ID=6 Hi Carlos:

All steps are done in the CustomDispForm.aspx

4. You can insert ListFormWebPart by going Insert->SharePoint controls->List form … . In the “List or Document Form” dialog choose your child list and “New item form” option.

5. Again in the same CustomDispForm.aspx just below list form web part you inserted in step 4. Select Insert->SharePoint controls->Web Part … and select child list web part. Actually you can insert it using SharePoint user interface by editing page in the browser.

6. Right mouse click on parent list folder in SharePoint Designer. Select Properties-> Supporting Files tab. Then select correct content type and Browse for the new display item form ( CustomDispForm.aspx). Best to do it when content type for which you are setting supporting files is the default content type configured in parent list settings (using standard SharePoint user interface).

3. You must replace the default ListFormWebPart that is already there when you copied the default DispForm.aspx and renamed it to CustomDispForm.aspx.

Also there is some bugs in last steps. You can find them explained in my blog over here http://www.sharepointdrive.com/blog/Lists/Posts/Post.aspx?ID=6

]]>
By: Mindaugas http://www.endusersharepoint.com/2009/09/25/sharepoint-document-generator-part-1-how-to-establish-a-parent-%e2%80%93-child-relationship-in-sharepoint/comment-page-1/#comment-20339 Mindaugas Thu, 10 Dec 2009 17:51:05 +0000 http://www.endusersharepoint.com/?p=2272#comment-20339 Hi, 1. If you are talking about child item form toolbar then you can remove it by adding following line just before tag: None 2. You can use here a couple of solutions : You can remove Source parameter from query string on page load and then redirect like this: $(document).ready( //using jQuery function() { var i = document.location.href.lastIndexOf("&Source"); if (i > -1){ document.location.href = document.location.href.substring(0,i);} } ); or You can use PreSaveAction() which is called just before form submit and change Source parameter in here. It may look like this: function PreSaveAction() { var srcUrl=GetSource(); var i = aspnetForm.action.lastIndexOf(srcUrl); aspnetForm.action = aspnetForm.action.substring(0,i) ; return true; } You can add JavaScript to the page using Content Editor Web Part. Hi,

1. If you are talking about child item form toolbar then you can remove it by adding following line just before tag:
None

2. You can use here a couple of solutions :

You can remove Source parameter from query string on page load and then redirect like this:
$(document).ready( //using jQuery
function()
{
var i = document.location.href.lastIndexOf(”&Source”);
if (i > -1){
document.location.href = document.location.href.substring(0,i);}
}
);

or

You can use PreSaveAction() which is called just before form submit and change Source parameter in here. It may look like this:

function PreSaveAction() {
var srcUrl=GetSource();
var i = aspnetForm.action.lastIndexOf(srcUrl);
aspnetForm.action = aspnetForm.action.substring(0,i) ;
return true;
}

You can add JavaScript to the page using Content Editor Web Part.

]]>
By: Carlos http://www.endusersharepoint.com/2009/09/25/sharepoint-document-generator-part-1-how-to-establish-a-parent-%e2%80%93-child-relationship-in-sharepoint/comment-page-1/#comment-20336 Carlos Thu, 10 Dec 2009 16:55:04 +0000 http://www.endusersharepoint.com/?p=2272#comment-20336 Hi Mindaugas, Thanks for publishing this..I am trying to accomplish something similar for a project dealing with Fire Rescue Weekly Supplies. What they need is to be able to submit weekly supply requests for each fire station. Each fire station will contain a list of pre-determined items to be associated with the Fire Station ID and the requested date....anyway...I followed exactly your above instructions...however for some reason they did not work for me! This is where I am currently stuck: steps 4-6 do not seem to work for me in Designer: 4. Add the new ListFormWebPart for the new child list item form. Choose the New item form in List or Document Form dialog. [This step is definitely NOT CLEAR, where do you do this? at the parent list level or the child list level?] I assumed it should be at the parent list level, so I went ahead and did it. 5. Add the child list Web Part for displaying all child list items. [same as above, parent or child?] I am currently stuck exactly between these 2 steps. Since designer is giving me an error and it is not allowing me to save the page. This is the error I am getting after making the changes as stated on steps 4 and 5: Server error: The URL 'Lists/Orders/CustomDispForm.aspx; is invalid. It may refer to a nonexistent file or folder that is not in the current Web. 6. Set CustomDispForm.aspx to be the parent list default display form. [how in the world do you do this if this option is grey out in designer?] I also notice in step 3 that we are supposed to do the replacement as follows: In the CustomDispForm.aspx replace ListFormWebPart with DataFormWebPart. [this step is previous as adding the new item form and child list form, which by the way overwrite the replacement...? I sincerely appreciate if you can walk me through this process, so I can get this accomplished. Thank you. Hi Mindaugas,
Thanks for publishing this..I am trying to accomplish something similar for a project dealing with Fire Rescue Weekly Supplies. What they need is to be able to submit weekly supply requests for each fire station. Each fire station will contain a list of pre-determined items to be associated with the Fire Station ID and the requested date….anyway…I followed exactly your above instructions…however for some reason they did not work for me! This is where I am currently stuck: steps 4-6 do not seem to work for me in Designer:

4. Add the new ListFormWebPart for the new child list item form. Choose the New item form in List or Document Form dialog. [This step is definitely NOT CLEAR, where do you do this? at the parent list level or the child list level?] I assumed it should be at the parent list level, so I went ahead and did it.

5. Add the child list Web Part for displaying all child list items. [same as above, parent or child?]
I am currently stuck exactly between these 2 steps. Since designer is giving me an error and it is not allowing me to save the page. This is the error I am getting after making the changes as stated on steps 4 and 5: Server error: The URL ‘Lists/Orders/CustomDispForm.aspx; is invalid. It may refer to a nonexistent file or folder that is not in the current Web.

6. Set CustomDispForm.aspx to be the parent list default display form. [how in the world do you do this if this option is grey out in designer?]

I also notice in step 3 that we are supposed to do the replacement as follows: In the CustomDispForm.aspx replace ListFormWebPart with DataFormWebPart. [this step is previous as adding the new item form and child list form, which by the way overwrite the replacement…?

I sincerely appreciate if you can walk me through this process, so I can get this accomplished.

Thank you.

]]>
By: ashiena http://www.endusersharepoint.com/2009/09/25/sharepoint-document-generator-part-1-how-to-establish-a-parent-%e2%80%93-child-relationship-in-sharepoint/comment-page-1/#comment-20324 ashiena Thu, 10 Dec 2009 15:02:43 +0000 http://www.endusersharepoint.com/?p=2272#comment-20324 Hye, Thank you for your post. I use it in my current project. whith parent and child i a different list. However a few questions to ask : 1. How do you remove the toolbar form. If I remove it, it will casue error to the page. 2. When i save the child using 'Add product' it will redirect to the child list. How can I set it to redirect to the same page? thank you in advanced Hye,

Thank you for your post. I use it in my current project. whith parent and child i a different list.

However a few questions to ask :

1. How do you remove the toolbar form. If I remove it, it will casue error to the page.

2. When i save the child using ‘Add product’ it will redirect to the child list. How can I set it to redirect to the same page?

thank you in advanced

]]>
By: BMorley http://www.endusersharepoint.com/2009/09/25/sharepoint-document-generator-part-1-how-to-establish-a-parent-%e2%80%93-child-relationship-in-sharepoint/comment-page-1/#comment-18532 BMorley Mon, 02 Nov 2009 16:23:16 +0000 http://www.endusersharepoint.com/?p=2272#comment-18532 Hi, This looks like a the perfect solution I've been looking for. I'm a lowly Site Collection Admin though so don't have access to DefaultTemplates.ascx as far as I know (can't find it within SPD at least). Any chance of some further details or code snippets to help us lesser mortals along our way? Thanks Ben Hi,

This looks like a the perfect solution I’ve been looking for. I’m a lowly Site Collection Admin though so don’t have access to DefaultTemplates.ascx as far as I know (can’t find it within SPD at least). Any chance of some further details or code snippets to help us lesser mortals along our way?

Thanks
Ben

]]>
By: SharePoint Document Generator - Part 2: Picking default columns values from a related list | End User SharePoint http://www.endusersharepoint.com/2009/09/25/sharepoint-document-generator-part-1-how-to-establish-a-parent-%e2%80%93-child-relationship-in-sharepoint/comment-page-1/#comment-17532 SharePoint Document Generator - Part 2: Picking default columns values from a related list | End User SharePoint Mon, 28 Sep 2009 17:02:54 +0000 http://www.endusersharepoint.com/?p=2272#comment-17532 [...] Articles in this seriesSharePoint Document Generator - Part 2: Picking default columns values from a related listSharePoint Document Generator - Part 1: How to establish a parent – child relationship in SharePoi... [...] [...] Articles in this seriesSharePoint Document Generator – Part 2: Picking default columns values from a related listSharePoint Document Generator – Part 1: How to establish a parent – child relationship in SharePoi… [...]

]]>
By: Mindaugas http://www.endusersharepoint.com/2009/09/25/sharepoint-document-generator-part-1-how-to-establish-a-parent-%e2%80%93-child-relationship-in-sharepoint/comment-page-1/#comment-17489 Mindaugas Fri, 25 Sep 2009 19:18:47 +0000 http://www.endusersharepoint.com/?p=2272#comment-17489 Hi Greg, Nice to know you liked it. Your question is exactly the one to which i still don't have the answer :) What I'm thinking (in my demo Sales Orders Management application) is to use event receivers to listen on child item changes and simply make changes to parent item. I hope that it will be one of my future posts. Hi Greg,

Nice to know you liked it. Your question is exactly the one to which i still don’t have the answer :)

What I’m thinking (in my demo Sales Orders Management application) is to use event receivers to listen on child item changes and simply make changes to parent item. I hope that it will be one of my future posts.

]]>
By: Steve French http://www.endusersharepoint.com/2009/09/25/sharepoint-document-generator-part-1-how-to-establish-a-parent-%e2%80%93-child-relationship-in-sharepoint/comment-page-1/#comment-17483 Steve French Fri, 25 Sep 2009 16:29:45 +0000 http://www.endusersharepoint.com/?p=2272#comment-17483 This is really good and I was following Mindaugas' blog as well. I think it would be helpful if you (or Laura) did a screencast to see how to aactually do this because as we've seen in some of Laura's previous screencasts, there are some finicky issues with modifying forms in SharePoint Designer. This is really good and I was following Mindaugas’ blog as well.

I think it would be helpful if you (or Laura) did a screencast to see how to aactually do this because as we’ve seen in some of Laura’s previous screencasts, there are some finicky issues with modifying forms in SharePoint Designer.

]]>
By: Greg http://www.endusersharepoint.com/2009/09/25/sharepoint-document-generator-part-1-how-to-establish-a-parent-%e2%80%93-child-relationship-in-sharepoint/comment-page-1/#comment-17481 Greg Fri, 25 Sep 2009 15:37:14 +0000 http://www.endusersharepoint.com/?p=2272#comment-17481 Hi Mindaugas, This is very interresting and clearly explained. will definitelly have to try your solution. Quick question: can you 'roll-up' calculated values from the child list to the parent one. (like the discount total amount or the count of product in the child list? Thanks for sharing, Greg Hi Mindaugas,
This is very interresting and clearly explained.
will definitelly have to try your solution.
Quick question: can you ‘roll-up’ calculated values from the child list to the parent one.
(like the discount total amount or the count of product in the child list?
Thanks for sharing,
Greg

]]>