Possible to convert a Record Producer to a Catalog item?

incrypto
Tera Contributor

Hi,
I have a couple large record producers (one has 73 variables) and I need to change them to Catalog Items. The original versions are client-facing forms that generate a Case; I've copied them and made them internal only and need to turn them into Catalog Items. Is this possible? And if so, how?

My normal method of converting a Catalog Item to a Record Producer by simply changing the Class is not an option (only Record Producer is available to select from the "Class" list). This is the case for all of the Record Producers I tested this on.

Thank you!
Steve

1 ACCEPTED SOLUTION

Just quickly tested this, thought will be quick then finding the topic 🙂

var gr = new GlideRecord('sc_cat_item');

if(gr.get('7434fcaf4f228410e7fe0ab18110c7dc')) {
	gr.setValue('sys_class_name', 'sc_cat_item');
//	gr.setValue('sys_class_name', 'sc_cat_item_producer');
	gr.update();
}

And the background script showing:

Change in class detected, switching from: sc_cat_item_producer to: sc_cat_item sys_id: 7434fcaf4f228410e7fe0ab18110c7dc

Looked at the list and the Record Producer (or now Catalog Item): looks fine! Obviously do test carefully and maybe even make an export to be sure.

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

View solution in original post

11 REPLIES 11

Great thank you very much! I'll let you know if I get this going successfully with my items.

Steve

Your fix script worked perfectly. I just swapped out the sys_id of course. Both forms fully function like they did before the switch.

Thanks again Mark.. that saved me easily a full day's worth of pretty tedious work!

Steve

Did you use the scripts for the original Record Producers?  if so, after conversion, how did you handle this feature being missing? were looking into moving a bunch of RP's over and this is a big sticking point for us.  any help or advice would be appreciated.

@Mark Roethof 

 

Does this work for the Scoped app Record Producer as well?

I ran your script but the Record Producer is still Record Producer.

But how to map fields ?