GlideModalForm adding value to field

S M
Tera Contributor

Hello Guys,

I have a UI Action on the change form and I need to display a dialog window with a specific View from a custom table called timeline. I am using GlideModalForm in order to achieve that but the problem is that I need to set the Parent field from timeline to the number from the parent change form. I tried to use the gModalForm.addParm('parent', sysId); but this is not working and the parent stay empty.

Here is the code:

function timelineDialog(){
      var sysId;
      if (typeof rowSysId == 'undefined')
             sysId = gel('sys_uniqueValue').value;
      else
          sysId = rowSysId;


      var gModalForm = new GlideModalForm('Timelines record', 'table_name);
       gModalForm.setPreference('sysparm_view', 'view_name');
       gModalForm.addParm('parent', sysId);
       gModalForm.setCompletionCallback(function(action_verb, sys_id, table, displayValue){
             if (action_verb == 'sysverb_update'){
                reloadWindow(window);
             }
       });
      gModalForm.render();
}

Any help will be appropriated, thank you in advance