- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2016 10:10 AM
I am calling my UI Page within iFrame. When I try to do ${RP.getParameterValue('sys_id')}, it is not returning the sys_id of the incident record. I think its because the UI Page is within iFrame. So, with javascript I was able to get the part of the url (Incident sys_id). Now, I want to use this sys_id in my jelly to query the incident table and display all values.
example: https://something.something.com/ess/incident_created.do?sys_id=13ecc01637915e0006c11f9543990e0a
<script>
var cmshelp_url = top.location.href;
var help_sysid = cmshelp_url.substr(cmshelp_url.length-32);
</script>
<j:set var="jvar_inc" value="${help_sysid}" /> // THIS IS NOT WORKING. ANY SUGGESTIONS?
<g:evaluate jelly="true">
var inc = new GlideRecord('incident');
inc.addQuery('sys_id', jelly.jvar_inc);
inc.query();
</g:evaluate>
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2016 11:47 AM
Try this out Rajinis !!!!
It would definitely work as I have used it before on CMS:
Pass value from URL To UI Page / Macro / Record Producer
#1: Using: JS
Assume iFrame URL has : &req_type=SOMETHING
UI page can have a script like:
function onLoad() {
var url = window.location.toString();
var parms = url.toQueryParams();
if (parms["req_type"] == "SOMETHING") {
/* do something here */
}
}
OR
#2 Using: Jelly
Assume iFrame URL has : &pointer_name=counter
<j:set var="jvar_pointer" value="${RP.getParameterValue('pointer_name')}" />
<j:if test="${jvar_pointer == 'counter'}">
<p>Hello World! - ${jvar_pointer}</p>
/* do something here */
</j:if>
Hope this help!
-Manjul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2016 10:43 AM
Hi rajinis,
Can you please change your parameter name and try?
UI Page code should be
<g:evaluate jelly="true">
gs.log("incident_created${sysparm_sysid}");
var inc = new GlideRecord('incident');
inc.addQuery('sys_id', '${syparm_sys_id}');
inc.query();
</g:evaluate>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2016 11:18 AM
Sorry. Not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2016 10:48 AM
Hi Rajinis,
In addition, you may find the below thread helpful.
Passing Javascript variables into Jelly Tags.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2016 11:11 AM
I just do this:
<g:evaluate jelly="true">
var inc = new GlideRecord('incident');
inc.addQuery('sys_id', "${help_sysid}");
inc.query();
</g:evaluate>