<input type="hidden" id="\${jvar_name}" name="\${jvar_name}" value="\${jvar_value}" class="\${jvar_class}" />
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2017 10:21 AM
can any one explain that code? if anyone use that code.
i read that code in wiki over the below link, but i could not understand code?
http://wiki.servicenow.com/index.php?title=Extensions_to_Jelly_Syntax#gsc.tab=0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2017 11:04 AM
Not sure if this is what you're looking for, but I'm using this on a custom UI page, which is called through a UI action. This is what the UI action script looks like:
function createApproval(){
var dialogClass = window.GlideModal ? GlideModal : GlideDialogWindow;
var gDialog = new dialogClass('ad_hoc_approval');
gDialog.setTitle('Request Additional Approval');
gDialog.setPreference('sysparm_id',g_form.getUniqueValue());
gDialog.setPreference('sysparm_table',g_form.getTableName());
gDialog.render();
}
On my UI page, I have the following at the top of the script:
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:ui_form>
<input type="hidden" id="cancel_or_submit" name="cancel_or_submit" value=""/>
<input type="hidden" id="item" name="item" value="${sysparm_id}"/>
<input type="hidden" id="table" name="table" value="${sysparm_table}"/>
I'm not using the "class" portion, but you can see that I'm setting a variable in my script that is using the setPreference I included in the script that calls the UI page. It's hidden because the end user doesn't need to see it on the UI Page, I'm using it in later scripting to fulfill the request (in this case, I'm giving ITIL users the ability to create a new approval on an RITM or Incident).
Then, in the "Client Script" portion of the UI Page, I can grab the variables like this:
var ritm = gel("item").value;
var tb = gel("table").value;
At this point, the Client Script can call a Script Include to process creation of the approvals with that information.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2021 05:55 AM
Hi Kristen ,
Could you please let me know how you have managed adhoc approval process and script how you configured ? I am struggling on this as i have same requirement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2017 11:38 AM
Hi Pida,
Lets break it into chunks :=
input type="hidden" -> this means a text box which will not be visible on the form but will be present on the form. We use it in scripting.
id ="jvar_name" -> Sevicenow uses jelly. In jelly a variable is named by using ' jvar_ ' prefix. So 'jvar_name" means it is a variable. If you remove 'jvar_' then jelly would not be able to identify this as a variable. for example if you want to make variable named xyz in jelly the you need to write jvar_xyz.
similarly
class="jvar_class" ->it means in the attribute class value will be assigned from the variable 'jvar_class'
Please mark this helpful and hit like if this helps you in understanding the code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2017 04:43 AM
Hi Pida,
Is there any thing else that you want to understand in the question you have posted. If yes then please bring forward your query. If your query is answered then please mark the appropriate answer as correct answer.