spacing between mrvs data on description of HR case
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2024 04:20 AM
Hi experts,
we are using below code to populate record producer variables on HR case description.
new sn_hr_core.hr_ServicesUtil(current, gs).createCaseFromProducer(producer, cat_item.sys_id);
But multirow variables set data is displaying without any spacing between two rows. How can we add spacing(newline) between two rows?
TIA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2024 05:55 AM
Hello @si21,
What are you preferred to write that code? Script include or record producer script?
Thank you!!
Dnyaneshwaree Satpute
Tera Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2024 06:18 AM
Hi @Dnyaneshwaree , this code is generally written on record producer script field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2024 06:40 AM
Hello @si21,
Ok, then please refer below code as an example of record producer script for required logic and update it as per your requirement:
(function() {
var caseDescription = '';
var multiRowVariableSet = producer.variables.your_multirow_variable_set;
var rows = multiRowVariableSet.split('\n'); // Assuming rows are separated by newlines
for (var i = 0; i < rows.length; i++) {
caseDescription += rows[i] + '\n\n'; // Adding an extra newline for spacing
}
// Set the formatted case description
current.description = caseDescription;
new sn_hr_core.hr_ServicesUtil(current, gs).createCaseFromProducer(producer, cat_item.sys_id);
})();
Thank you!!
Dnyaneshwaree Satpute
Tera Guru