Draft feature for Record Producer

Abhishake1
Giga Contributor

Hi Developers,

Has anyone implemented a draft state feature for Record Producer,if yes then please share the way or is it possible to have this for record producer or not.

Regards,

Abhishek

19 REPLIES 19

Danny81
Tera Contributor

There's out of box functionality called Wish List.  This can do what you want.  You can also easily update the wording to say Draft List if you prefer.  All the widget terms can be overridden via UI messages.  I've posted an update setto the developer share site with all the necessary UI messages already created.  You can download it here.

The out of the box wishlist is kinda lacking in some functionality, you can only save one "draft" per record producer. So if you want multiple, you need to rewrite the widget.

Danny81
Tera Contributor

This is true, but Wish List will meet most of the needs most of the time for this situation and I would highly recommend trying it first before taking on the technical debt involved with cloning major widgets like SC Catalog Item among others.  Often times, you find that people are OK with one saved item at a time. 

 

To be fair, it would be trivial for SN to update the code to support multiple saved items, still not sure why they haven't at this point.

There's actually very little technical debt if you clone the widget and add it to your own page. And then utilize Page Route Maps. You thereby isolate the custom widget to only the portals and pages you want it to apply to. No need to edit OOTB widgets or pages

shivam316
Tera Contributor

i used the below code to make state as draft when new record is inserted via record producer to my custom table

var gr = new GlideRecord('target_table_name');
gr.initialize();
gr.state = 'Draft';
gr.field_name1 = producer.variable_name1;
gr.field_name2 = producer.variable_name2;
gr.insert();