Pass values from the child item which is opened in the dialog box to the parent form

Hello @mnikitina
I am trying to use the code you provided in a submit button and it does not work. It keeps giving me an error in the console and above the form that it can not "Cannot read property 'field' of undefined."

Both fields are Date and Time.

This is the field from the parent form "Ultima_x0020_dat_x0103_"
This is the field from the child form "Dat_x0103__x0020_sf_x00e2_r_x021"
I even tried to invert them. :slight_smile:

Here is the code:

fd.spBeforeSave(function(spForm) {
var parentForm = window.top.fd;

parentForm.field('Ultima_x0020_dat_x0103_').value = fd.field('Dat_x0103__x0020_sf_x00e2_r_x021').value;
return fd._vue.$nextTick();
});

return fd.save();

The thing that I'm trying to do is to pass the date from the form that pop-ups from List or Library Control to a date field in the initial form.
Can you please tell me what am I doing wrong?

Thank you!

Hello @Vasilii_Burca,

Have you defined fd globally in the parent form?

Please add this code in the parent form and double-check the internal names of the fields.

window.fd = fd;
1 Like

Hello @mnikitina,

Thank you very much everything worked fine as always. Have a good weekend.

1 Like