- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2019 08:29 AM
Hello Team,
We have html block of Jelly code to display attachments with checkbox on UI page. Please help me to understand, why Attachment_ has used in the expression of evaluate tag..
<g2:evaluate var="jvar_name" expression="'Attachment_' + att.sys_id"/>
<g2:evaluate var="jvar_x" expression="gs.getPreference('Attachment_' + att.flag)"/>
code snippet for reference:
Code is trying to check/uncheck checkbox based on the flag value set on sys_attachment (att) table. except the given lines, no where I found the reference of Attachment_ on UI page.
Thanks & Regards,
Indira Priya Darsini M.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2019 09:39 AM
Hi,
The <g2: evaluate> jelly tag sets the value of declared variables. So for the following lines:
<g2:evaluate var="jvar_name" expression="'Attachment_' + att.sys_id"/>
<g2:evaluate var="jvar_x" expression="gs.getPreference('Attachment_' + att.flag)"/>
That is setting the variable 'jvar_name' to equal Attachment_' + att.sys_id & it is setting the variable 'jvar_x' to the preference value returned by gs.getPreference('Attachment_' + att.flag)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2019 09:39 AM
Hi,
The <g2: evaluate> jelly tag sets the value of declared variables. So for the following lines:
<g2:evaluate var="jvar_name" expression="'Attachment_' + att.sys_id"/>
<g2:evaluate var="jvar_x" expression="gs.getPreference('Attachment_' + att.flag)"/>
That is setting the variable 'jvar_name' to equal Attachment_' + att.sys_id & it is setting the variable 'jvar_x' to the preference value returned by gs.getPreference('Attachment_' + att.flag)