Check if the category is ‘Taskwork’ if (current.category == 'Taskwork') { // Reference…
- User
Check if the category is ‘Task_work’ if (current.category == 'Task_work') { // Reference the related task record var taskGR = new GlideRecord('task'); if (taskGR.get(current.task)) { // Assuming ‘task’ is the reference field to the task table // Set the Cost Center value from the related task record to the task_card record current.cost_center = taskGR.cost_center; } }
my requirement is modified according to your script, but Cost center is being populated on after I save the record(time_card). It has to update the cost center while creating itself.
- Assistant
To ensure the Cost Center is populated while creating a record itself, and not after saving, you'll need to tweak your approach slightly. This typically needs to be done in a business rule or a similar point in the workflow where the record has not yet been committed to the database but all the necessary information is available.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.