Need popup tab in RITM request with few questions.

Abhishek Barik
Tera Contributor

Hi Team,

We have a requirement to have a pop-up tab in RITM request post catalog item submission so that catalog task developers post things done need to fill the popup tab fields. Once filled, it needs to be shown in the RITM.
Request your help in this regard!


Thanks,

Abhishek

6 REPLIES 6

Sohail Khilji
Kilo Patron
Kilo Patron

Hi @Abhishek Barik ,

 

The below onload client script and scriptinclude will help..

 

 

function updateRITMField() {
    var userInput = prompt("enter the information:"); 
    if (userInput !== null) { 
        var ritmSysId = 'RITM_SYS_ID';  //gliderecord from task table and set the sys_id of ritm here in this variable
        var ga = new GlideAjax('UpdateRITMField'); 
        ga.addParam('sysparm_name', 'updateField'); 
        ga.addParam('sysparm_ritm_sys_id', ritmSysId ); 
        ga.addParam('sysparm_user_input', userInput); //user input will be passed here
        ga.getXMLAnswer(updateFieldCallback); 
    }
}

function updateFieldCallback(response) {

    if (response) {
        alert("Field updated successfully!"); 
    } else {
        alert("Failed to update field.");
    }
}

 

 

Script include :

 

var ritmSysId = this.getParameter('sysparm_ritm_sys_id');
var userInput = this.getParameter('sysparm_user_input');
        
        var gr = new GlideRecord('sc_req_item');
        if (gr.get(ritmSysId)) {
            gr.setValue('field_to_update', userInput); // Replace 'field_to_update' with the actual field name to update
            gr.update();
            return true; 
        }
        return false; // else will return false or not updated....
    }
});

 


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

Hi @Sohail Khilji ,
Thanks for the details but we dont want to update a RITM field.
Our requirement is to have a Pop up window with 5 fields asking to fill those fields and show them in the RITM level.
This pop up should come when a specific sc task is closed in the RITM and once the agent closed let's say second task, this pop up should come with questions and the agent should fill them to proceed with the next third sc task creation only after filling the details and those filled details should show some where in RITM request either in worknotes or somewhere to get stored.