Cross Site Lookup Add New Item

rss

Posted by Hubbaroo - Apr 4 ’14 at 04:07

Using the Cross SIte Lookup Add New Item feature how would I pass extra field values other than the ID to use in the destination form?

 

Thanks again.

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 6 years 2 months 20 days
    #1 by Dmitry Kozlov Apr 6 ’14 at 06:33

    Hello,

    You can retrieve any field value of the parent from the child via JavaScript if you open the child form in a dialog. The following code demonstrates how to get Title of the parent form:

    window.top.fd.field('Title').value()

    You should put the code above into the child New form.

  • Hubbaroo
    Member
    Member for: 6 years 2 months 21 days
    #2 by Hubbaroo Apr 7 ’14 at 12:22

    Will this work if the Parent form is in Dialog?

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 6 years 2 months 20 days
    #3 by Dmitry Kozlov Apr 8 ’14 at 03:53

    [#2]: If you open the parent form in a dialog, please, try to put the following code into the child form:

    $('.ms-dlgFrame', window.top.document)[0]
    .contentWindow.fd.field('Title').value()
    
  • Hubbaroo
    Member
    Member for: 6 years 2 months 21 days
    #4 by Hubbaroo Apr 8 ’14 at 01:43

    Great approach but I keep getting "Undefined" in the alert below no matter what field name I use???

     

    var rate = $('.ms-dlgFrame', window.top.document)[0].contentWindow.fd.field('Title').value();
    alert(rate);

  • Hubbaroo
    Member
    Member for: 6 years 2 months 21 days
    #5 by Hubbaroo Apr 8 ’14 at 04:27

    I found the answer. I was using the display form and needed to use the _el in the syntax. The current script works great from the edit form.

     

    Thanks for all of your help!

  • Hubbaroo
    Member
    Member for: 6 years 2 months 21 days
    #6 by Hubbaroo May 1 ’14 at 05:29

    [#5]: In the this thread you showed me how to get the dialog form that opens another form so we can get data from the initial form onto the new form. This is working great. Now we are opening an initial form in dialog, then a child form in dialog then creating a new form in dialog, maybe several layer deep. I do understand how to get each of the dialog forms, what I need help with is how to get the last dialog form opened before the current new form.

     

    Thank you.

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 6 years 2 months 20 days
    #7 by Dmitry Kozlov May 2 ’14 at 03:09

    [#6]: If you have multiple dialogs opened at the same time, you can retrieve their content by index:

    $('.ms-dlgFrame', window.top.document)[index]
    .contentWindow.fd.field('Title').value()
    
  • Hubbaroo
    Member
    Member for: 6 years 2 months 21 days
    #8 by Hubbaroo May 2 ’14 at 03:38

    [#7]: I did find that but was looking for a way to detirmine how many are open or at lease the last one opened before the current one. Can I loop over a collection of them?

     

    Thanks

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 6 years 2 months 20 days
    #9 by Dmitry Kozlov May 6 ’14 at 04:35

    [#8]: Getting the number of opened dialogs:

    $('.ms-dlgFrame', window.top.document).length

    Loop over the list of dialogs:

    $('.ms-dlgFrame', window.top.document).each(function(i) {
       // 'i' is an index
       // 'this' is a document object 
    });
Displaying 1 to 9 of 9 messages