add a title in worknote & comments
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2024 01:04 AM
Hello everyone,
From Washington DC. version I have regular incidents that come up concerning comments that are written several times, or even written in the name of other people. You should know on the instance on which I work there is a BR which exists and which adds a title to each comment according to business logic, of which here is an extract:
if (answer == 'true') {
current.work_notes = current.assignment_group.getDisplayValue() + "\n ****************************";
}
// If the current logged in user has an Initial Group
else if (answer != 'true' && !groupInit.nil()) {
// Fill the Incident Initial Group field
current.work_notes = groupInit.getDisplayValue() + "\n ****************************";
}
After analysis, I realized that the script in question had modified the value of the comment field but on the sys_journal_field table it created two records: 1 with the text of the comment, the other with the title. (see screenshot).
I therefore decided to change this operation, and to do the work on the client side by adding a Client script which, according to the same business logic, adds the title to the comment upon submission. It works very well except that...
if the user clicks on the post button, then the comment is added without submitting the form, therefore without launching my client script. (I tried to do another client script on the edit one, or we change but nothing to do) and as soon as I make a rule on the server side, then this stores two records on the sys_journal_field table, and therefore this amounts to what I don't want to, so as not to end up with the same incident...
Does anyone have any leads or ideas, thank you very much in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2024 08:10 AM
I already thought about that, but is it a good practice to empty a table that is responsible for doing an audit, is it not dangerous to handle it directly?? I fear for a version release, or update...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2024 09:10 AM
This is less risky as it's a controlled deletion of history records that have a replacement record. Another approach would be to find the Business Rule that updates (the incident) when the comment is updated on the sys_journal_field table, and get it to not do that if the comment without the header already exists, then update that record in the history to add the header.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2024 06:15 AM
My client decided to stop this idea, thanks for your answers!