- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2016 09:28 PM
Hi All,
I have a dynamic block on homepage , in dynamic content I have created a button and onclick of button I am calling a function and based on the input(userid) given , reports will be populated for that particular user. This is working fine.
But i want the same functionality ,When the homepage loads, it should get logged in user id and populate records.
I tried calling function in div tag but its not working, how to call function onload in jelly script.
Thanks in advance.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2016 11:44 PM
Add this to your existing script below xyz function defintion
addLoadEvent( function() {
xyz();
});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2016 10:08 PM
Hi Swamy ,
Its not working. I need to use dashboardMessageHandler as well for setting filter. Please suggest how to achieve this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2016 10:17 PM
Hi Jeevitha,
Please post your code to edit.
May be you can use below in onloadfunction.
function onLoadFunction()
{
var IDuser = "${gs.getUserID()}";
top.window.location = "/sys_report_list.do?sysparm_query=user=" + IDuser;
}
Thanks and regards,
Swamy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2016 10:32 PM
Hi Swamy,
This is what I have done for button part(onclick), same way I need to do on OnLoad.
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<script>
function xyz()
{
var userID=prompt('Enter User ID');
if(userID!='' & userID!= undefined ){
var my_dashboardMessageHandler1 = new DashboardMessageHandler("my_unique_id2");
var query=''; //my query
my_dashboardMessageHandler1.publishFilter('incident',query);
}
}
</script>
<input id="onlyMine" type="button" value="Show Filtered Records" onclick="xyz();" />
</j:jelly>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2016 10:47 PM
Hi Jeevitha,
Create a UI page instead of dynamic content and use the below script
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<script>
addLoadEvent( function() {
onLoadFunction();
});
</script>
</j:jelly>
client script:
function onLoadFunction()
{
var userID=prompt('Enter User ID');
if(userID!='' && userID!= undefined ){
var my_dashboardMessageHandler1 = new DashboardMessageHandler("my_unique_id2");
var query=''; //my query
my_dashboardMessageHandler1.publishFilter('incident',query);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2016 10:52 PM
Hi Swamy,
I tried it, it is not working for dashboardMessageHandler, it works only on dynamic content itseems.