@Rayamondo
I have something similar, to add new names using a JS button, then close dialog, refresh so new names appear on the dropdown list with new name.
This is what works for me:
function redirectToNewForm(){var options = {title: "Your Title",url: 'http://xxxxList/allitems.aspx',dialogReturnValueCallback:Function.createDelegate(null, portal_modalDialogClosedCallback)};SP.UI.ModalDialog.showModalDialog(options);}function openDialog(pageUrl) {var options = {url: pageUrl,title: 'Employee List',allowMaximize: false,showClose: true,width: 800,height: 880,dialogReturnValueCallback: RefreshOnDialogClose};SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);}
Hey @Nunezma - thanks for your reply.
I have used your code, which is a nicer solution than what I had 🙂 However, I still have the same issue where the List Lookup field is not being updated with the latest addition. The new item is successfully created in the list, but is not available in the List Lookup.
@Rayamondo
the only other thing I have is call the JS funciton using a javascript button and under client click I have: OpenDialog('listURL')
Hey @Nunezma,
I have used your openDialog function as a client click already, and it works nicely to display the newItem page.. just for some reason doesn't update the List Lookup. I haven't used the redirectToNewForm() function at all though; I assumed the openDialog function would do all I needed.
Thanks again for your responses.