can we merge description and other field data in the description of the facility request

charushk
Tera Contributor

can we merge description and other field data in the description of the facility request
using only record procuder script not cluent script
I have wrote this

current.description = producer.description + "-" + "Need replacement vehicle : " + producer.u_need_replacement_vehicles;
but its not working



charushk_0-1748518638192.png

 

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@charushk 

I could see it's working as expected.

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

GlideFather
Tera Patron

Have you tried logging the values after the record producer's submission?

add something like

gs.info("charushk - value in the producer: " + producer.u_need_replacement_vehicles);

And you will see what values it gets you and eventually you can add there "producer.u_need_replacement_vehicles.getDisplayValue()"
———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


EDIT: I just tested it and it works okay, it depends on the field type (reference, string etc.) getDisplayValue() for references and dates, toString() for sys ids..

for the logging above, then use this URL:
https://your-instance.service-now.com/syslog_list.do?sysparm_query=sys_created_onONToday%40javascrip...

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */