Page 1 of 1

Passing a lookup field to related Items control

Posted: 10 Jun 2014
by bnunweiler
Hello. I have a new form which will add items to a list (and refresh after each item), and a related items control under it, which will view all the items in the list. However, since it's the same list the Data Source, it won't let me Filter by a lookup field. I set a Parent ID when I add items to the list; can I set the Parent ID with JS, so that the Related Items only show the items just added?


Please let me know if this doesn't make any sense.


Thanks

Re: Passing a lookup field to related Items control

Posted: 11 Jun 2014
by Dmitry Kozlov
Hello,

You cannot add related items from a new form because there is no ID of the parent item to link it with children. First, you have to create a parent item and then add related items from its edit form. So I would recommend you to design the New form without related items control and put JavaScript code to redirect users to the Edit form right after creation as described in the following post:

http://spform.com/forms-designer- ... sharepoint

Put the related items control onto the Edit form and filter them by the lookup field in the Data Source configuration dialog.

Feel free to ask the questions.