- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-10-2015 10:01 PM
HI All,
I am facing problem in accessing the parameters passed through url.In my first UI page i am passing a "meetingId" value through url and fetching that parameter in my second UI page and use this value to query in second UI page.
I used the below code:
In my first page:
<a href="add.do?sysparm_meetingId=$[meeting.u_meeting_id]">Link</a>
In second UI page:
<j:set var="jvar_meeting_id" value="${sysparm_id}" />
<g2:evaluate var="jvar_act" object="true" jelly="true">
var act = new GlideRecord('u_actionitem');
act.addQuery('u_meeting_id','=', jelly.jvar_meeting_id);
act.query();
</g2:evaluate>
Code doesn't work.
Any help will be highly appreciated.
Thanks.
Jennifer
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-10-2015 10:13 PM
Hi Jennifer,
I think you've nearly got it. One thing stands out to me, on your second UI Page, that first line should change to:
<j:set var="var_meeting_id" value="${sysparm_meetingId}" />
Notice that the value inside the dollar sign - curly braces is the same as the parameter value passed in the first UI Page. This is a convention used by ServiceNow and is documented here: http://wiki.servicenow.com/index.php?title=UI_Pages#Invoking_a_Page
Personally, I prefer to to declare this more explicitly using RP. Personally, I find the parameter convention makes the script harder to understand. Here is the more explicit approach that I like for the second page:
<g2:evaluate var="jvar_act" object="true">
var meetingId = RP.getParameterValue('sysparm_meetingId');
var act = new GlideRecord('u_actionitem');
act.addQuery('u_meeting_id','=', meetingId);
act.query();
</g2:evaluate>
I hope this has helped!
Edit: Heres the docs on RP Extensions to Jelly Syntax - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-11-2016 04:28 AM
Hi Jennifer
Can you please tell what changes you made to make the code work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2016 09:38 PM
Hi Surya,
I initially made that field as read-only in the form and tried to auto-populate the values from UI page but it didn't work, so I disabled 'Read-only' option for that field and tried and I was able to auto-populate the value to that field when I click on the 'Add' button.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2017 01:25 PM
The ServiceNow Wiki content is no longer supported. Updated information about this topic is located here: UI Pages
Visit http://docs.servicenow.com for the latest product documentation