- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2023 08:42 AM
Use Case: I have a scheduled job that updates duration fields every 12 hours.
- I don't want the scheduled job to create work notes, (because everyone would get notified too often, and it would clutter the notes tab).
- I do have the duration fields checked in the Activity formatter because I do want a work note created when someone manually changes the value from the form.
- I need to business rules to run when the job runs (so setWorkFlow probably won't work for this situation)
So basically: How can I prevent a scheduled job from creating work notes, but also create work notes when the field(s) are manually updated?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2023 11:18 AM
That was very helpful, @Arun_S1 , but it didn't quite work for me.
My solution:
- I removed the duration fields from the Activity Formatter on the form, which prevented the scheduled job to create work notes when it executed.
- Then I used your suggestion of creating a business rule to create a work note when a user manually made the change:
(function executeRule(current, previous /*null when async*/ ) {
var user = gs.getUserDisplayName().toString();
current.work_notes = user + " updated the Blocked Duration from " + previous.u_blocked_duration.getDisplayValue() + " to " + current.u_blocked_duration.getDisplayValue();
})(current, previous);​
Worked like a charm. Thanks again for the assistance!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2023 11:18 AM
That was very helpful, @Arun_S1 , but it didn't quite work for me.
My solution:
- I removed the duration fields from the Activity Formatter on the form, which prevented the scheduled job to create work notes when it executed.
- Then I used your suggestion of creating a business rule to create a work note when a user manually made the change:
(function executeRule(current, previous /*null when async*/ ) {
var user = gs.getUserDisplayName().toString();
current.work_notes = user + " updated the Blocked Duration from " + previous.u_blocked_duration.getDisplayValue() + " to " + current.u_blocked_duration.getDisplayValue();
})(current, previous);​
Worked like a charm. Thanks again for the assistance!!