Lookup field is not being saved


I'm opening a new list item form from another one (in dialog). To set the value of related lookup field I used this code.
fd.field("AssignedTicket").value = Dialog.getArgs().parentID;
I can see, the field is being set with its parent ID. After saving the form the lookup value get lost.
Any ideas what is going wrong here?
I also found a code example from @Nikita_Kurguzov , he mentioned to use fd.field('AssignedTicket').widget.dataSource.data() to set the lookup. Is that necessary?


Hello @Alex,

How do you open the dialog? Are you using the List or Library control?

Hi mnikitina

I'm using this code from another form (the parent list)

dialogUrl = _spPageContextInfo.webAbsoluteUrl + "/SitePages/PlumsailForms/"+listName+"/CSM%20Comment/NewForm.aspx";


    { parentID: parseInt(parentID), partnerID: parseInt(window.TicketPartnerID) },

    function (hasSaved) {


            //alert('Form in dialog has saved and closed.');

            //refresh related items after creation.


            getComments(listTitle, window.itemId, "#ticketComments");



            //alert('Dialog form was closed without saving!');



    //{ width: 800, height: 600 }



You can pass parent item id to the form opened in dialog using the approach from this article:

the issue is not getting parent ID. I have the parent ID in the child form, I also set the value to the parent value.

fd.field("AssignedTicket").value = Dialog.getArgs().parentID;

After saving that, AssignedTicket lookup is empty. It is not empty after saving, if I pick the value manually from its dropdown. But it is empty if its being set by e.g.

fd.field("AssignedTicket").value = 105;

is it possible, that fields are not being saved if they are disabled by fd.field().disabled = true; ?

--> if I open the form directly (not in dialog) and set the lookup vie console fd.field("AssignedTicket").value = 105; the value will besaved as expected.
Seems to be an issue if opened in dialog.

OK I found the solution, it is here Managing common fields with JavaScript — SharePoint forms (plumsail.com)

Returns promise that is resolved when the field has fully loaded. Useful for executing scripts as soon as the field fully loads.

Only available for List or Library control, Person or Group, Lookup and Content Type SharePoint fields!


fd.spRendered(function() {
fd.field('User').ready().then(function(field) {
// or

fd.field('ContentType').ready().then(function(field) {
    // or


1 Like