Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Create a linked item on click without a custom form

  Asked By: Carlos    Date: Mar 06    Category: Sharepoint    Views: 3647

A user has a list where they create some rather complex items. Now they
want to be able to click a link and create child items in a separate list...
BUT they don't want to have to pick the parent item from a choice field in
the New Item form. Has anybody ever done this? Due to time constraints,
I'd like to avoid creating custom forms for the child list, but it's looking
like I won't have that option. Please feel free to prove me wrong.

Share: 

 

11 Answers Found

 
Answer #1    Answered By: Silvia Wilkinson     Answered On: Mar 06

I would also love to achieve this....................

 
Answer #2    Answered By: Candy Walter     Answered On: Mar 06

Can you give an example of this? Not sure how the child  would know what parent
it belongs to without the user  selecting from a list.

 
Answer #3    Answered By: Leanne Rios     Answered On: Mar 06

I'm envisioning a customized link  on the View form  of the parent  item. That
way you have all the data at your disposal and clicking "create new child"
will pass the info along. The key, of course, is getting the
(non-customized) child  form to recognize it.

 
Answer #4    Answered By: Zachary Roberts     Answered On: Mar 06

Would the child list  just show a NewForm.aspx with the fields filled out or
would you actually commit list items  to the child  list?

Either way you could use an HttpHandler (ASHX) to accomlish this. In the first
use case above you could use JSON. In the second use case you could just use
object model code...

 
Answer #5    Answered By: Maura Durham     Answered On: Mar 06


When I have a master list  connected to three sublists, whenever I click  New on
the sublist, the field  which links to the master ought to automatically be set
to the correct master lookup. (It drives my users crazy to create  a customer
record and then have to choose the correct company for that customer when we
just came from a screen where the company was already selected. Does that make
sense?

 
Answer #6    Answered By: Jagat Pandit     Answered On: Mar 06

A simple way to do it is use a Edit menu item  to create  an item in the child
list.

Whenever the menu item is clicked, create an item in the child list  set the
choice field  to parent  item and navigate the user  to the edit form  of the newly
created item.

The downside is that item in the child  list will always be created, even if you
cancel the edit form (without saving), but will save you from creating  custom
forms.

 
Answer #7    Answered By: Jerod Carrillo     Answered On: Mar 06

You mean by attaching a workflow to the parent  list? I'd thought of that...
but as you mentioned, it does have the unpleasant result of creating  before
completion. Even so, it could work.

The problem is when the user  wants to create  multiple child  items. I may
need to do some experimenting here. Maybe there's a way to fool the New
Item form  with URL parameters.

 
Answer #8    Answered By: Hema Pasupuleti     Answered On: Mar 06

You may use the workflow, but my idea was to create  a aspx page in layouts, pass
the ID of the parent  list item  in query string to the layout page and do the
processing.

Another thing you can do it to use javascript. Still you have to create an edit
menu item in parent list. Redirect the user  to NewForm.aspx of child list  and
pass parent item ID in query string. Then either
1) Create a custom  webpart and add it to NewForm.aspx. The webpart should read
the query string, and add javascript on the page that will initialize the
fields on onload() of NewForm.aspx.
2) You can use a content editor webpart and use javascript to retrieve query
string parameters and do the same trick.

Note: you will have to use (1) if you need any other field  than the ID of the
parent list item. as only ID parameter can be passed in query string of edit
menu item.
Â
Give me some more informartion about how and why would you want to create
multiple child items  in same list.

 
Answer #9    Answered By: Candis Kinney     Answered On: Mar 06

Thanks for taking some time  to think about this. To be clear, I'm
taking about creating  child items  in a different list. That is, there is
one list  with parent  items, and another with child  items. Think of it like
two database tables in a one-to-many relationship.

I'm not clear on what you mean by "create an edit menu item". I do see
what you mean about using JavaScript, which was my only thought for making
this work except that it would require me to edit the default form; I guess
I can alter the NewForm if I don't mess with anything beyond adding a CEWP,
which would (assumedly) do what I want.

Again, thanks for helping me to work through this. That should probably
do the job.

 
Answer #10    Answered By: Cora Bradshaw     Answered On: Mar 06

Please clarify:

"...in a separate  list...BUT they [don't] want to have to pick the parent  item
from a choice  field in the New item  form."

Or:

"...in a separate list...BUT they [DO?] want to have to pick the parent item
from a choice field  in the New Item form."

 
Answer #11    Answered By: Shushma Zariwala     Answered On: Mar 06

User goes to view parent  item.

User decides (while in View item  form) to create  a child  item.

User clicks link  and New Item form  magically appears with the information
about the parent item.

The issue here is getting the child New Item form to recognize the info sent
in the querystring. I could add some JS to the page (though of course at
that point we're customizing, which I'm trying to avoid) but it would be
nice if there were a magic built-in parameter that the default form would
recognize and say "oh, you want this linked  field to point to Item X".

Linked fields are easy. It's just the "default New Item form recognizes
value from URL" part that has me wondering.

 
Didn't find what you were looking for? Find more on Create a linked item on click without a custom form Or get search suggestion and latest updates.




Tagged: