
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2025 08:23 AM
Getting "Could not save record because of a compile error: JavaScript parse error at line (42) column (82) problem = missing } in compound statement (<refname>; line 42)" when trying to save the script in this record producer for our service catalog. Please help!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2025 08:39 AM
Hi @Community Alums
} is missing in multiple places.
PFB for the valid script.
current.caller_id = gs.getUserID();
current.location = gs.getUser().getLocation();
var grLookup = new GlideRecord("dl_u_assignment");
grLookup.addQuery("location", gs.getUser().getLocation());
grLookup.query();
if (grLookup.next()) {
current.assignment_group = grLookup.assignment_group;
}
current.contact_type = "self-service";
current.impact = 2;
current.urgency = 2;
current.priority = 3;
if (current.category == "ERP") {
if (current.subcategory == "D365") {
if (current.u_level3_category == "Production Control") {
current.applyTemplate("ERP - Production Control");
} else if (current.u_level3_category == "Inventory Management") {
current.applyTemplate("ERP - Inventory Management");
} else if (current.u_level3_category == "Master Planning") {
current.applyTemplate("ERP - Master Planning");
} else if (current.u_level3_category == "Modules") {
current.applyTemplate("ERP - Modules");
} else if (current.u_level3_category == "Procurement and Sourcing") {
current.applyTemplate("ERP - Procurement and Sourcing");
} else if (current.u_level3_category == "Product Information Management") {
current.applyTemplate("ERP - Product Information Management");
} else if (current.u_level3_category == "Sales and Marketing") {
current.applyTemplate("ERP - Sales and Marketing");
} else if (current.u_level3_category == "Tablet") {
current.applyTemplate("ERP - Tablet");
} else if (current.u_level3_category == "Warehouse Management") {
current.applyTemplate("ERP - Warehouse Management");
} else if (current.u_level3_category == "Finance") {
current.applyTemplate("ERP - Finance");
}
}
}
if (current.category == "Inquiry / Help") {
if (current.subcategory == "HR") {
current.applyTemplate("HR Incidents");
}
}
if (current.category == "Applications") {
if (current.subcategory == "Workday") {
current.applyTemplate("HR Workday Incidents");
}
}
Hope this helps.
Regards,
Siva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2025 08:39 AM
Hi @Community Alums
} is missing in multiple places.
PFB for the valid script.
current.caller_id = gs.getUserID();
current.location = gs.getUser().getLocation();
var grLookup = new GlideRecord("dl_u_assignment");
grLookup.addQuery("location", gs.getUser().getLocation());
grLookup.query();
if (grLookup.next()) {
current.assignment_group = grLookup.assignment_group;
}
current.contact_type = "self-service";
current.impact = 2;
current.urgency = 2;
current.priority = 3;
if (current.category == "ERP") {
if (current.subcategory == "D365") {
if (current.u_level3_category == "Production Control") {
current.applyTemplate("ERP - Production Control");
} else if (current.u_level3_category == "Inventory Management") {
current.applyTemplate("ERP - Inventory Management");
} else if (current.u_level3_category == "Master Planning") {
current.applyTemplate("ERP - Master Planning");
} else if (current.u_level3_category == "Modules") {
current.applyTemplate("ERP - Modules");
} else if (current.u_level3_category == "Procurement and Sourcing") {
current.applyTemplate("ERP - Procurement and Sourcing");
} else if (current.u_level3_category == "Product Information Management") {
current.applyTemplate("ERP - Product Information Management");
} else if (current.u_level3_category == "Sales and Marketing") {
current.applyTemplate("ERP - Sales and Marketing");
} else if (current.u_level3_category == "Tablet") {
current.applyTemplate("ERP - Tablet");
} else if (current.u_level3_category == "Warehouse Management") {
current.applyTemplate("ERP - Warehouse Management");
} else if (current.u_level3_category == "Finance") {
current.applyTemplate("ERP - Finance");
}
}
}
if (current.category == "Inquiry / Help") {
if (current.subcategory == "HR") {
current.applyTemplate("HR Incidents");
}
}
if (current.category == "Applications") {
if (current.subcategory == "Workday") {
current.applyTemplate("HR Workday Incidents");
}
}
Hope this helps.
Regards,
Siva

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2025 08:55 AM
Fixed! Thank you!