Activity Formatter Help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2016 10:53 PM
I found that in one of the threads we can have the activity formatter in the UI page as you can see below
with this script
UI Macro
- <?xml version="1.0" encoding="utf-8" ?>
- <j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
- <link rel="stylesheet" href="/styles/css_includes_ng.cssx"/>
- <nav class="navbar navbar-default section_secondary" data-id="991fec850a0006417c9edda2d4e9c487" data-type="section_head">
- <div class="container-fluid">
- <div class="navbar-header">
- <h3 class="form_header">Activity</h3>
- </div>
- <div class="navbar-right">
- <span>
- <button alt="Collapse" title="" class="icon-chevron-right btn btn-icon" tabindex="1" onclick="hideReveal('section'); return false;" data-original-title="Display / Hide"></button>
- </span>
- </div>
- </div>
- </nav>
- <g:function record_table="REQUIRED" record_id="REQUIRED" />
- <g:activity sys_id="${jvar_record_id}" fields="" table="${jvar_record_table}"
- type="changes" var="jvar_activity"/>
- <div id="section" class="h-card-wrapper activities-form col-xs-10 col-md-9 col-lg-8 form-field">
- <j:forEach items="${jvar_activity}" var="jvar_history">
- <li class="h-card h-card_md h-card_comments">
- <div class="sn-card-component sn-card-component_first sn-card-component_meta sn-card-component_meta_sibling">
- <span class="sn-card-component-createdby">${jvar_history.get(0).getValue('sys_created_by')}</span>
- </div>
- <div class="sn-card-component sn-card-component_first sn-card-component_meta">
- <span class="sn-card-component-time">
- <div class="date-calendar">${jvar_history.get(0).getValue('sys_created_on')}</div>
- </span>
- </div>
- <g:activity type="labels" records="${jvar_history}" var="jvar_field_labels"/>
- <div class="sn-card-component sn-card-component_records">
- <div class="sn-widget">
- <ul class="sn-widget-list sn-widget-list-table">
- <j:forEach items="${jvar_history}" var="jvar_h">
- <li>
- <span class="sn-widget-list-table-cell">${jvar_h.getValue('fieldname')}</span>
- <span class="sn-widget-list-table-cell">
- <span>${jvar_h.getValue('newvalue')}</span>
- </span>
- <j:if test="${jvar_h.getValue('oldvalue').trim().toString().length()!=0}">
- <span class="sn-widget-list-table-italic ng-scope">was</span>
- <span class="oldValue">${jvar_h.getValue('oldvalue')}</span>
- </j:if>
- </li>
- </j:forEach>
- </ul>
- </div>
- </div>
- <hr/>
- <div class="sn-card-component_accent-bar sn-card-component_accent-bar_dark">
- </div>
- </li>
- </j:forEach>
- </div>
- <script>
- function hideReveal(sectionName) {
- $j("#"+sectionName).toggle("hide");
- $j(".icon-chevron-right").toggleClass("hideBtn");
- }
- </script>
- <style>
- .oldValue{
- padding-left:5px !important;
- }
- .hideBtn{
- -webkit-transition: -webkit-transform 0.3s;
- -ms-transition: -ms-transform 0.3s;
- transition: transform 0.3s;
- -webkit-transform: rotate(90deg);
- -ms-transform: rotate(90deg);
- transform: rotate(90deg);
- font-size: 18px;
- }
- </style>
- </j:jelly>
IN UI Page
- <?xml version="1.0" encoding="utf-8" ?>
- <j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
- <! record_table holds table name & record_id holds sys_id of record-->
- <g:inline template="custom_activity" record_table="incident" record_id="<SYS ID OF Your Incident>" />
- </j:jelly>
This will show us the activity in a separate UI page , BUT when iam trying to change the code for the below activity formatter it is coming in my UI Page. Any Help
Any Help on this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2016 04:15 AM
Thanks Gurpreet i will try to modify.
One minor ask is that these Baseline difference is a formatter kind of i can't find the fieldname for it. Do you know where to check on that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2016 04:35 AM
Like if you want to make a check for comments then include a condition for backend name of comments ... ideally it should be u_comments.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2016 04:55 AM
Thanks Gurpreet.. I think you mistaken the requirement i need.
1.There is a field called Comments in UI page ( text/area ).
2. Now in computers table there is a CMDB Baseline Diff is there , this gives us the difference in CI (any changes) made from the time of Baseline created auto populated in dropdown.
3. I want to pull this difference data whether it is a attribute change or relationship change we need to pull these information into the comments fields in UI page.