Access parent form values in lookup "add new" form (modern)
Is it possible to access data from a new form which is called from a lookup using the"add new item"form?
I did not find any usable context information in the expression builder for the initial value. In RichForms I can submit an URL parameter to the new form so I could use this parameter to get my information.
As a dirty hack I used jQuery to access the information but when you change the DOM-Tree, this will not work anymore:
var parentVPInput = $('div[data-fieldname="icVertragspartner"]').find('input');
if (parentVPInput.length > 0) {
return parentVPInput[0].value;
}
else {
console.log("Keinen Vertragspartner gefunden");
}
-
Felix Müller at the moment there is no such possibility since we cannot pass parameters from this "add new item" button and there is no connection between the two forms.
Another approach which is not affected by DOM changes could be to store the values needed in a window variable to make it accessible on the overlaying NewForm.
In my case below I've used an enabled expression on another control like a row or button which sets the value and returns true. By using a skybow placeholder [[]] it automatically registers a change event, that the variable is set/updated when the field is changing.
Kind regards
Matthias
0
Please sign in to leave a comment.
Comments
1 comment