Related Items auto fill related ID requires quick edit mode?

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
Dan_C
Posts: 63
Joined: Tue Dec 02, 2014

22 Apr 2016

I have a ticket list and a ticket updates (comments) list. The updates lookup from the ticket list ids. I added related items in the ticket form to show/add/edit updates, but I don't want users to have to select the id with each update.

According to this blog:

http://spform.com/forms-designer- ... point-form

To autofill the id of the parent list item in the related items list I need to use quick edit mode. I don't like quick edit mode though because it seems to allow adding columns to the updates list (+) and requires clicking into a new row to save the entry.

I'd like to let them click new item, hit enter to save the entry, and disable the + to add a new column... can this be accomplished with quick edit mode as in the blog or do I need to take a different approach (I've read forum posts here about dialog? How?) Any instructions/blog that could help improve the related items interface as I mentioned but also populate the related ticket id automatically?

User avatar
rostislav
Moderator
Posts: 364
Joined: Mon Oct 19, 2015

25 Apr 2016

You can go the popup way and retrieve the parent id via the topmost iframe, set the id on the popup form. So, e.g. on the popup form add the following code:

Code: Select all

if (window.top != window.self){
    fd.field('parent').value(window.top.GetUrlKeyValue('ID'));
}
You may hide the parent field with css ('display:none;')

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

26 Apr 2016

Currently, you can add related items on the new form in the grid mode only. But you can redirect users to the edit form automatically right after saving where they will be able to add related items through the 'Add item' link:

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

Dan_C
Posts: 63
Joined: Tue Dec 02, 2014

26 Apr 2016

How do I pop up the sub form?

User avatar
rostislav
Moderator
Posts: 364
Joined: Mon Oct 19, 2015

27 Apr 2016

Switch the related items control to Quick Edit = None or Optional and use the code I posted on the popup form. However, this will only work on an edit form, not new.

Dan_C
Posts: 63
Joined: Tue Dec 02, 2014

27 Apr 2016

Thanks.

Any way I can prevent the related list item from being created anywhere except the parent list update?
Or any way I can use a url to pass the parent id into a related item new item form from outside the parent edit form, such as from a filter web part?

User avatar
rostislav
Moderator
Posts: 364
Joined: Mon Oct 19, 2015

28 Apr 2016

You can try this: if the entity is created via a popup you can hide the parent lookup field and fill it in programmatically, whereas it's created not via a popup, let the user fill it in himself. If you have too many elements, you can use the Cross-Site Lookup plugin.

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests