
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2022 12:57 PM - edited 12-09-2022 01:04 PM
Is there a way to grab special instructions from the request container and apply it to comments of the requested item? For example:
current.comments = current.parent_request.special_instructions
thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2022 04:44 AM
You shouldn't ever need to do a GR on sc_req_item to retrieve the current record, because the current record is what the workflow is running on. I added a one line Run Script activity as the first activity following Begin, and this worked for me:
current.comments.setJournalEntry(current.request.special_instructions);
Just using current.comments = didn't work in this case, but I knew the special_instructions were getting picked up correctly by adding a logging line
workflow.info('SI ' + current.request.special_instructions);
then viewing the log via the Log tab on the Workflow Context Related Link on the RITM. The workflow runs on the sc_req_item table when the record is created, which is after the sc_request (REQ) record is created, so I've never experienced any trouble with retrieving or updating any fields on the RITM or REQ records right off the bat.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2022 04:44 AM
You shouldn't ever need to do a GR on sc_req_item to retrieve the current record, because the current record is what the workflow is running on. I added a one line Run Script activity as the first activity following Begin, and this worked for me:
current.comments.setJournalEntry(current.request.special_instructions);
Just using current.comments = didn't work in this case, but I knew the special_instructions were getting picked up correctly by adding a logging line
workflow.info('SI ' + current.request.special_instructions);
then viewing the log via the Log tab on the Workflow Context Related Link on the RITM. The workflow runs on the sc_req_item table when the record is created, which is after the sc_request (REQ) record is created, so I've never experienced any trouble with retrieving or updating any fields on the RITM or REQ records right off the bat.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2022 04:00 AM
Well Brad... you got me on this one 🙂 I don't know why it wasn't working before but it's working now. I suspect I had something else breaking the code because your example worked. Thanks!