- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2023 11:40 AM - edited 09-03-2023 12:40 PM
Hi,
How can I redirect a record producer that is executed on native SN (when the record producer is accessed from a module URL link) to the newly created HR Case form after submission? Is there an option redirect to the newly created HR Case instead of modifying oob script include?
Script in Record producer:
new sn_hr_core.hr_ServicesUtil(current, gs).createCaseFromProducer(producer, cat_item.sys_id);
OOB script include is redirected to HR list view:
In the 'Record producer', the 'Redirect to' field is set to 'Generated task record'. However, after submitting, it redirects to the HR Case list view instead of the newly created record.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2023 01:00 AM
found simple solution, just put it in record producer script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2023 02:15 PM
If I understand your question, try these steps.
To redirect a user to the newly created HR Case form after submitting a Record Producer accessed from a module URL link, you can achieve this by customizing the "On Submit" script of the Record Producer. You can use a server-side script in the "On Submit" script field to capture the newly created HR Case and then redirect the user to that record. Here's a step-by-step guide:
- Create a new UI Page:
You'll need to create a custom UI Page that contains the redirect script. Follow these steps:
Go to "System Definition" > "UI Pages."
Click "New" to create a new UI Page.
Name the UI Page (e.g., "RedirectToHRCase").
Set the content type to "Client Script."
In the script field, add the following JavaScript code to redirect to the newly created HR Case:
This script will automatically redirect the user to the newly created HR Case form.
- Update the Record Producer "On Submit" Script:
In your Record Producer configuration, update the "On Submit" script to use the UI Page you created above. Replace the existing code with the following:
Replace /$URI_TO_YOUR_UI_PAGE with the actual URI to your custom UI Page. For example, if your UI Page name is "RedirectToHRCase," the URI would be "/$RedirectToHRCase."
Now, when the user submits the Record Producer, they will be redirected to the newly created HR Case form after the case is created.
Good Luck,
James
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2023 01:00 AM
found simple solution, just put it in record producer script