Client script to add Alert() message to HRSD document task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-08-2024 03:09 PM
OnLoad Client script with just alert("TEST") on HRSD document task is not running when accessed from service portal whereas it works fine when I access the same document task in the desktop. I have defined UI type as "All" and tried turning Isolated scripts on and off as well. Nothing seem to work. Any idea what could be the reason. Please help.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2024 07:27 AM
Hello @SonaK -
It may help the community if you shared some screenshots of your form and the script you are using. That way, someone could possibly identify an error.
If you shared what you have, I could for example, duplicate it in my own dev instance and see if it works properly or not. And from there debug, adjust, etc.
Could you share your OnLoad Client Script form and the script you are using when trying to accomplish your task?
Thank you so much,
-Rob

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2024 09:19 AM
@SonaK How are these document task shown on the Service Portal? Via a record producer? If yes then you need a Catalog client script for a record producer. The client script which is running fine on the platform/desktop view may not even trigger in case of service portal as the backend form is different than the record producer shown on the service portal.
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2024 10:26 AM
Hi. Thanks for your input. The task that I am working on to display an alert is a document task that is under to-dos list on employee portal configured as a widget. The task will open as a pdf document viewer. I am trying to see if I can add an alert without changing the widget (it looks like an OOB widget so I may need to clone and change just for an alert message). Please advise.
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2024 08:29 PM
@SonaK If this is a widget then you need to put your alert inside the client controller of the widget.