Page 1 of 1

Related Items auto fill related ID requires quick edit mode?

Posted: 22 Apr 2016
by Dan_C
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?

Re: Related Items auto fill related ID requires quick edit mode?

Posted: 25 Apr 2016
by rostislav
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;')

Re: Related Items auto fill related ID requires quick edit mode?

Posted: 26 Apr 2016
by Dmitry Kozlov
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

Re: Related Items auto fill related ID requires quick edit mode?

Posted: 26 Apr 2016
by Dan_C
How do I pop up the sub form?

Re: Related Items auto fill related ID requires quick edit mode?

Posted: 27 Apr 2016
by rostislav
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.

Re: Related Items auto fill related ID requires quick edit mode?

Posted: 27 Apr 2016
by Dan_C
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?

Re: Related Items auto fill related ID requires quick edit mode?

Posted: 28 Apr 2016
by rostislav
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.