How to Set field message for Risk field based on the filter on change form

Atik
Tera Contributor

Hello Everyone,

 

I have requirement for the change form, actually requirement is I have 2 fields on change form Disruption which is choice field, and Business Criticality.

And In the Risk Conditions all filters are added when Risk changes then Info message to set that Risk has been changed to High, Moderate or low.

I have to check this filters with the value of disruption and Business criticality, as soon as user changes the value of Disruption which is drop down I have to show there if you save this form then Risk is going to be set as 'expected value' meaning High moderate.

I was trying with this below code which is static one I wanted to make this dynamic,

var changeGR=new GlideRecord('change_request');
changeGR.get('b4e19ec74fcca200989697411310c778');
var riskGR = new GlideRecord("risk_conditions");
riskGR.addActiveQuery();
riskGR.orderBy('order')
riskGR.query();
var match=false;
while(riskGR.next() && !match){
gs.print(riskGR.condition);
match=GlideFilter.checkRecord(changeGR,riskGR.condition);
if(match)
gs.print(riskGR.getDisplayValue('risk'));
}

It will be great if some one can help me out here,

 

Thanks in Advance

Atik Bagwan.

0 REPLIES 0