UI Macro - How to get the value of a reference field in jelly?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2023 06:29 AM
Good day!
In the incident form, I have UI macro beside the caller name. The UI macro serves as an identifier to show if the caller is a member of a specific group. When hovering the mouse over the icon, I need to show the group name.
When populating the incident form, how do I get the value of the caller field in jelly?
Thank you in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2023 09:30 AM - edited 04-21-2023 09:32 AM
g_form inside a <g2:evaluate/>? Really?
So much for
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2023 09:28 AM - edited 04-21-2023 09:29 AM
This will fetch the Caller:
<?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 type="text/javascript">
g_form.getReference('caller_id', u_onCallerID);
function u_onCallerID (recordSet) {
if (recordSet.rows.length > 0) {
var empID = recordSet.employee_number;
console.log(empID);
}
}
</script>
...
</j:jelly>
and will print it to the browser's console.
It uses the asynchronous version of g_form.getReference; so add all code that should be executed when the result is available to function u_onCallerID.