Related Items auto fill related ID requires quick edit mode?

rss

Posted by Dan_C - Apr 22 ’16 at 11:18

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://formsdesigner.blogspot.com/2015/09/inline-spreadsheet-style-edit-mode-for.html

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?

  • rostislav
    rostislav
    Moderator
    Member for: 5 years 3 months 11 days
    #1 by rostislav Apr 25 ’16 at 04:01

    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:

    if (window.top != window.self){
        fd.field('parent').value(window.top.GetUrlKeyValue('ID'));
    }
    

    You may hide the parent field with css ('display:none;')

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 6 years 10 months 25 days
    #2 by Dmitry Kozlov Apr 26 ’16 at 04:10

    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://formsdesigner.blogspot.com/2013/10/how-to-open-edit-form-right-after.html

  • Dan_C
    Member
    Member for: 5 years 8 months 20 days
    #3 by Dan_C Apr 26 ’16 at 02:54

    [#1]: How do I pop up the sub form?

  • rostislav
    rostislav
    Moderator
    Member for: 5 years 3 months 11 days
    #4 by rostislav Apr 27 ’16 at 07:20

    [#3]:

    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
    Member
    Member for: 5 years 8 months 20 days
    #5 by Dan_C Apr 27 ’16 at 04:41

    [#4]: 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?

  • rostislav
    rostislav
    Moderator
    Member for: 5 years 3 months 11 days
    #6 by rostislav Apr 28 ’16 at 08:10

    [#5]: 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.

Displaying 1 to 6 of 6 messages