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

Checking for mrvs in a business rule

debrasimpson
Tera Contributor

In a business rule how can I test for the presence of a mrvs in a record created from a record producer. I can check if there are variables using if (current.u_variables_present == true) but it's not including the mrvs. Is there an equivalent statement for mrvs?

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@debrasimpson 

Is there any field which you are populating in the target table to identify record created from which record producer?

If yes then you can get that record producer sysId and query "io_set_item" with that record producer with type as this

var recordProducerSysId = current.u_record_producer;

var query = 'variable_set.type=one_to_many^sc_cat_item=' + recordProducerSysId;

var gr = new GlideRecord("io_set_item");
gr.addEncodedQuery(query);
gr.query();
if (gr.next()) {
	// this record producer has MRVS in it
}

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

5 REPLIES 5

Thanks, Ankur.

This is what I was looking for.

Deb