- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2023 12:59 AM
I have to add data to description on record Producer script field.
Look it's not as easy as i though, I have part of script which is working properly:
current.description = 'Store: ' + "\n" + producer.store.getDisplayValue() + "\n" +
'Division: ' + "\n" + producer.division.getDisplayValue() + "\n" + 'Department: ' + "\n"
+ producer.department.getDisplayValue();
current.short_description = 'Allocation Request';
And after that I want to add extra data to current.description if:
else if(producer.b_baby_boys_outerwear == 'true'){
current.description = 'baby: ' + "\n" + producer.b_baby_boys_outerwear;
}
but description is overwritten...
How to get resolve?
Solved! Go to Solution.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2023 01:07 AM - edited 10-18-2023 01:09 AM
Hi @DIVI1
If I have understood your requirement correctly, this needs to be done in a single go.
if(producer.b_baby_boys_outerwear == 'true'){
current.description = current.description + 'baby: ' + "\n" + producer.b_baby_boys_outerwear;
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2023 01:01 AM
Hi,
You may need
else if(producer.b_baby_boys_outerwear == 'true'){
current.description = current.description+' '+'baby: ' + "\n" + producer.b_baby_boys_outerwear;
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2023 01:01 AM - edited 10-18-2023 01:02 AM
Hi @DIVI1
You can add like this:
else if(producer.b_baby_boys_outerwear == 'true'){
current.description += 'baby: ' + "\n" + producer.b_baby_boys_outerwear;
}
or
else if(producer.b_baby_boys_outerwear == 'true'){
current.description = current.description + 'baby: ' + "\n" + producer.b_baby_boys_outerwear;
}
Whichever you prefer.
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2023 01:20 AM
Not working unfortunately :
I don't know why 😮
if(producer.division != 'b'){
current.assignment_group = 'ee1caba147c655108195c60cd36d43f5';
current.description = 'Store: ' + "\n" + producer.store.getDisplayValue() + "\n" +
'Division: ' + "\n" + producer.division.getDisplayValue() + "\n" + 'Group: ' + "\n"
+ producer.group.getDisplayValue() + "\n" + 'Department: ' + "\n"
+ producer.department.getDisplayValue() + "\n" + 'Baby Group: ';
current.short_description = 'Allocation Request';
}
else if(producer.b_baby_boys_outerwear == 'true'){
current.description = current.description + 'baby: ' + "\n" + producer.b_baby_boys_outerwear;
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2023 01:25 AM
If its a true false, you may need to treat it like this:
if(producer.division != 'b'){
current.assignment_group = 'ee1caba147c655108195c60cd36d43f5';
current.description = 'Store: ' + "\n" + producer.store.getDisplayValue() + "\n" +
'Division: ' + "\n" + producer.division.getDisplayValue() + "\n" + 'Group: ' + "\n"
+ producer.group.getDisplayValue() + "\n" + 'Department: ' + "\n"
+ producer.department.getDisplayValue() + "\n" + 'Baby Group: ';
current.short_description = 'Allocation Request';
}
else if(producer.b_baby_boys_outerwear == true){
current.description = current.description + 'baby: ' + "\n" + producer.b_baby_boys_outerwear.toString();
}
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.