Prepopulate reference field in GlideModal

VickV
Tera Contributor

Hello, 

we have a scenario in which we need to prepopulate a reference field in a GlideModalV3.

 

So heres the setup. We have a form with related lists.

One of the related lists is a m2m table..

In this m2m related list, we have custom New ( UI action ) that is client callable as well.

When New is clicked,

const gm = new GlideModal(
'modal_identifier,
false,
700,
);
gm.setPreference('table', 'm2m table');
gm.render();
So the pop up shows. But we need to prepolate it with a dynamic value ( the code for getting the value is not important ).
However, we are having trouble setting the value of the reference field of the m2m table after the modal pops up.
setPreference('fieldName', value), does not work.
Any suggestions on how to approach it? Or use (how to get) the g_form of the Modal and set it there?
0 REPLIES 0