Help with the scenario

SandeepKSingh
Kilo Sage

When user opens the existing incident and there is the parent incident of the same incident then there should be a message at the top “this incident is child xxxx incident” and when user click on parent incident number, it should open the same incident in new tab.

3 ACCEPTED SOLUTIONS

zayang
Tera Sage

@SandeepKSingh You should be able to configure a display business rule to achieve this.

 

Query: Parent Incident is NOT EMPTY

Script: gs.addInfoMessage("This incident is a child incident of <INCxxxxxx>"

View solution in original post

Sid_Takali
Kilo Patron

Hi @SandeepKSingh Try below onLoad client script 

 var parentIncidentId = g_form.getValue('parent'); 
    if (parentIncidentId) {
        var message = 'This incident is a child incident of ' +  parentIncidentId + 'incident.';
        g_form.addInfoMessage(message);

View solution in original post

Ravi Gaurav
Giga Sage

Hello,

 

Please use onLoad CS

 


var incident = g_form.getValue('parent')
if (incident) {
var message = "This incident is a child of incident <a href='incident.do?sys_id=" + parentIncident + "' target='_blank'>" + parentIncident.getDisplayValue() + "</a>";
g_form.addInfoMessage(message);
}
}

 

View solution in original post

4 REPLIES 4

zayang
Tera Sage

@SandeepKSingh You should be able to configure a display business rule to achieve this.

 

Query: Parent Incident is NOT EMPTY

Script: gs.addInfoMessage("This incident is a child incident of <INCxxxxxx>"

Sid_Takali
Kilo Patron

Hi @SandeepKSingh Try below onLoad client script 

 var parentIncidentId = g_form.getValue('parent'); 
    if (parentIncidentId) {
        var message = 'This incident is a child incident of ' +  parentIncidentId + 'incident.';
        g_form.addInfoMessage(message);

Ravi Gaurav
Giga Sage

Hello,

 

Please use onLoad CS

 


var incident = g_form.getValue('parent')
if (incident) {
var message = "This incident is a child of incident <a href='incident.do?sys_id=" + parentIncident + "' target='_blank'>" + parentIncident.getDisplayValue() + "</a>";
g_form.addInfoMessage(message);
}
}

 

Bert_c1
Kilo Patron

The above doesn't work for me. 'g_form.getRecord()' is not documented. the client script will need to use GlideAjax to get the number value of the parent_incident field.

 

[edit] I see the above was edited to remove the g_form.getRecord() and that there is now 'parentIncident' on the line that builds the message to display. However 'parentIncident' is never initialized. Folks should test solutions before posting.

 

[Edit 2]

The OP has changed here. The request here has little value as the Incident form has a related list of "Related Records", where the 'parent_incident' is shown with an icon to open that record.