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.spRendered(function(){
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?
{ parentID: parseInt(parentID), partnerID: parseInt(window.TicketPartnerID) },
function (hasSaved) {
if(hasSaved){
//alert('Form in dialog has saved and closed.');
//refresh related items after creation.
window.getGroups();
getComments(listTitle, window.itemId, "#ticketComments");
}
else{
//alert('Dialog form was closed without saving!');
}
}//,
//{ width: 800, height: 600 }
);
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.
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.