The CreatorCon Call for Content is officially open! Get started here.

Vendor risk management

sushma9
Tera Contributor

Hi All,

Good day to all,

I have requirement to avaoid the duplicate vendor assessment  to the vendor .vendor can see the assessments under the assessment in the related list and  Once any vendor assessment is created to a vendor amd if next time that same assessment is went to the same vendor i have check the same assessment in the related list kf assessments in the vendor and i need to stop the assessment and need to populate the error message . How can i avoid the duplicate assessments for any vendor  in assessments in the related list .Please find the attached script .

script :

Before Br , insert / Update and table name is sn_vdr_risk_asmt_assessment 

Var vendorName = current.getDisplayValue("fild name and its refence field");
Var assessmentName = current.name ;
Var gr = new GlideRecord(" core _company");
gr.addQuery("filed name " , vendorName );
gr.query();
If (gr.next()){
Var gr1 = new GlideRecord("sn_vdr_risk_asmt_assessment");
gr1.addQuery("core_company", gr.sys_id);
gr1.addQuery("name" , assessmentName);
gr1.query();
if(gr1.next()){
gs.addErrorMessage("duplicate record is found);
return false ;
}
}
return true ;

5 REPLIES 5

@sushma9 Could you please share the screenshots of your business rule and the table on which you would like to check duplicate assessment.