- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2023 12:47 PM
hi all
When I select the UI form button fore cancel change, a reason field displays where I can enter reason for cancelling the change, I did like to auto populate this reason to the close note so I dont have to re-enter in upon canceling
Thanks in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2023 07:15 PM
Hi @Malo
Please replace with the reason with the work_notes and test the code. It will work for sure.
Murthy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2023 01:26 PM - edited 09-25-2023 01:28 PM
(function executeRule(current, previous /*null when async*/ ) {
current.close_notes.setDisplayValue("current.reason");
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2023 03:28 PM
This is wrong, will set the value on the close notes to current.reason
The goal here is to display whatever data I have enetered in the reason to populate in the close note field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2023 04:44 PM
Hi @Malo
You need to write a before update BR on change request when state changes to cancelled or you can update the OOB UI action if you want to copy everytime when change cancelled.
With before update BR:
(function executeRule(current, previous /*null when async*/ ) {
current.close_code = "unsuccessful"; //optional
current.close_notes = current.work_notes.getJournalEntry(1).match(/\n.*/gm).join('').replace(/^\s*\n/gm, "");
})(current, previous);
It will copy the latest worknotes into close notes filed.
With UI action:
Find the cancel change ui action and use the same logic if you want to do.
(=tested)
Thanks,
Murthy
Murthy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2023 07:38 PM
Ideally this will only occur once because when you select cancel change, it cancels out the change request. I just want to document the close reason to be the same reason for what is entered in the reason field when it pops up
If I may ask, what would be the logic behind it copying every-time? Just looking to get a better understanding.
for your solution, however, I am looking to copy the reason and not the work note
OOB frunctionality, when you click on cancel change it displays that text box and is mandatory, I did like whatever I enter i this box to populate on the close note
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2023 11:29 PM
Hi @Malo
Yes. I understood your scenario. Use my above code it will work.
(=tested in my PDI)
Thanks,
Murthy
Murthy