UI action - GlideModal

Andrew_TND
Mega Sage
Mega Sage

Hello, I'm having some problems with a UI action.

The project_change_request form loads no problem I just cant seem to get the fields to auto populate... I also need the parent project record passed to the the other table too in the parent field.

Thanks in advance.

 

function clickDialog() {

    var sysid = g_form.getUniqueValue();

    var window = new GlideModal("project_change_request");
    window.setTitle('Milestone Approval');
    window.setSize(800, 350);
    window.setPreference("sysparm_view", "milestone_approval");
    window.setPreference("sysparm_u_milesone_record", sysid);
    window.render();
};

 

 

6 REPLIES 6

Tai Vu
Kilo Patron
Kilo Patron

Hi @Andrew_TND 

Could you share more details about what you're aiming to achieve with the auto-populate functionality?

 

Cheers,

Tai Vu

Overall what I'm trying to achieve is for a user to complete the dialog box for project_change_request and once submitted creates a new record in said table which also populates the parent id from the pm_project_task and the original project task sys_id in the u_milestone_record field.

 

Hi @Andrew_TND 

Thanks for the explanation! I now understand that after the user submits the dialog box, a new record in the project_change_request table gets generated, and after that, you want to populate a field on the current form with the new record just created in the other table from the user's submission.

To achieve this, you can simply extend the script you’re using to insert the new record. Once the new record is inserted, you can query the current record (where the dialog box is submitted) and update the relevant field with the newly generated record’s information.

 

Are you facing any issues with querying or updating a record after inserting project_change_request? Or I might be understanding your case wrongly?

 

Cheers,

Tai Vu

I did a quick test by creating Change Request through GlideModal. Then I populate the Change Request field on the Incident form.

Timi_1-1729069932712.pngTimi_2-1729069935541.png

 

Timi_4-1729069995372.png

 

Cheers,

Tai Vu