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 02:40 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2016 03:35 AM
Any idea on this formatter?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2016 03:45 AM
Okay, So you are saying that .... you want a formatter for a different table but not baseline diff. Do you want it for incident table ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2016 03:51 AM
No, I want it for baseline Diff.
Actually Iam trying to pull out the activity values( like Basic attribute changes and Relationship value changes) as shown in screenshot above under Base line Difference to a field called comments in UI page which i created.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2016 04:05 AM
Okay got it ... so need further customization of the code. I could suggest the place where you need to make changes but you need to modify code and troubleshoot.
Please look into below code part .. .this code retrieving all fields captured in history in a loop... customize accordingly ... like add a if statement inside loop ....
if jvar_h.getValue('fieldname') == comments
<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>