Hide "Rate type " column on time sheet portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2025 05:59 AM
Hi All ,
I want to hide "Rate type" Column on time sheet portal it's related out of box functionality.
Regards,
Anish
@Ankur Bawiskar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2025 06:38 AM
share the complete HTML, client, server widget code here
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2025 07:19 AM - edited 03-18-2025 08:21 PM
HTML -
<div id="tc-grid">
<div class="grid-header clearfix">
<span class="tc-grid-header">${Logged Time Cards}</span>
<span class="pull-right clearfix" ng-if="::data.canCreateTimecards">
<span class="fa fa-question-circle pull-right" uib-tooltip="${Search any task that you have worked during the week and add to the Time Sheet.}"
tooltip-placement="left" aria-label="${Help}"></span>
<button type="button" class="btn btn-link pull-right" ng-click="addTask()" id="add-task" aria-haspopup="true">${Add unassigned tasks to Time Sheet}</button>
</span>
</div>
<div class="tc-grid-cntr" ng-if="data.list.length">
<div class="table-responsive">
<div class="tc-table-layout">
<div class="container" id="tc-grid-table" role="table" aria-label="Timecards">
<div role="rowgroup">
<div class="flex table-headers" role="row">
<div scope="col" ng-repeat="field in ::data.fields track by $index" class="flex-item {{field}}" ng-class="{'selected':data.highlightedField == field}"
role="columnheader" ng-style="{{::getWidth(field)}}">
<div class="th-title {{field}}">
<strong class="wrap-text">{{::data.column_meta[field].label}}</strong>
</div>
</div>
<div class="flex-item placeholder" role="columnheader">
<a href="Javascript:void(0);" class="icon-ellipsis-vertical more-action-btn"></a>
</div>
</div>
</div>
<div class="table-body" role="rowgroup" ng-style="::tableBodyStyles">
<div ng-repeat="item in paginatedList track by item.sys_id" repeat-complete="tc-grid" class="flex tc-row" id="{{::item.sys_id}}" ng-class="{'active': data.timecardInEditMode == item.sys_id, 'disabled': !item.canEdit, 'rejected-desc' : item.state.value === 'Rejected'}"
tabindex="{{item.canEdit ? 0 : -1}}" ng-dblclick="editRow($event, item);" ng-keydown="keyHandler($event, item, $index)"
aria-disabled="{{!item.canEdit}}" aria-selected="{{data.timecardInEditMode === item.sys_id}}" aria-label="{{item.messages.rowDisplayMessage}}"
role="row">
<div ng-repeat="field in ::data.fields track by field" class="{{::field}} flex-item" data-field="{{::field}}" data-th="{{::data.column_meta[field].label}}"
ng-class="{'selected':data.highlightedField == field}" role="cell" ng-style="{{::getWidth(field)}}">
<div class="{{field}} text-elipsis" ng-if="data.timecardInEditMode != item.sys_id || !data.column_meta[field].editable">
<div class="tc-value" ng-class="{'disp-flex align-center' : $first}">
<span ng-if="$first" class="state-icon" uib-tooltip="{{item.messages.stateDisplayMessage}}" tooltip-placement="right"
tooltip-append-to-body="true" ng-class="{'icon-workflow-pending' : (item['state'].value === 'Pending'), 'icon-workflow-progress' : (item['state'].value === 'Submitted'), 'icon-workflow-check' : (item['state'].value === 'Processed' || item['state'].value === 'Approved'), 'icon-workflow-rejected' : (item['state'].value === 'Rejected'), 'icon-workflow-skip icon-flipped': (item['state'].value === 'Recalled')}"></span>
<span class="tc-desc" uib-tooltip="{{item[field].display_value}}" tooltip-enable="$first" tooltip-placement="auto top-left"
tooltip-append-to-body="true" ng-if="(( (field === 'rate_type' || field === 'resource_plan') || (data.isProjectActive && field === 'project_time_category')) && !item[field].value)">${None}</span>
<span class="tc-desc text-elipsis" ng-if="!(( (field === 'rate_type' || field === 'resource_plan') || (data.isProjectActive && field === 'project_time_category')) && !item[field].value)">
<span>
<p class="text-elipsis" uib-tooltip="{{item[field].display_value}}" tooltip-placement="auto top-left" tooltip-append-to-body="true">{{item[field].display_value}}</p>
<div ng-if="field === 'task.short_description' && item[field].number">
<a target="_blank" class="anchor-tag" ng-href="/{{::item['task.sys_class_name'].value}}.do?sys_id={{::item['task.sys_id'].value}}">{{item[field].number}}</a>
</div>
</span>
</span>
<div data-id="{{::item.sys_id}}">
<a href="Javascript:void(0);" ng-if="$first && item.isDuplicate && (data.timecardInEditMode != item.sys_id)" uib-popover-template="'mergeTc'"
popover-class="duplicate-popover" popover-animation="true" popover-placement="auto right"
popover-trigger="outsideClick" popover-is-open="data.mergePopover{{item.sys_id}}"
class="duplicate-tc fa fa-exclamation-triangle" ng-click="adjustPopover($event)"
uib-tooltip="${Merge Duplicate Time cards}" tooltip-placement="auto right" tooltip-append-to-body="true"
tooltip-is-open="data.mergeTp{{item.sys_id}}" ng-mouseover="tooltipEnable($event,true)"
aria-label="show or hide merge timecards popover" role="button"></a>
</div>
</div>
</div>
<div ng-if="data.timecardInEditMode == item.sys_id && data.column_meta[field].editable && (field !== 'rate_type' && field !== 'project_time_category' && field !== 'resource_plan')"
class="edit_mode">
<label class="sr-only" for="{{field}}">{{field}}</label>
<input type="text" id="{{field}}" name="{{field}}" ng-model="item[field].display_value" class="tc-row-input day-input" ng-class="{'error': item[field].invalid}"
ng-change="validateInput(item[field])" aria-invalid="{{item[field].invalid}}" aria-required="true"
required/>
</div>
<div ng-if="data.timecardInEditMode == item.sys_id && data.column_meta[field].editable && (field === 'rate_type' || field === 'resource_plan') && (item.state.value === 'Pending' || item.state.value === 'Rejected' || item.state.value === 'Recalled')" class="select2_field">
<label class="sr-only" for="{{field}}">{{field}}</label>
<input type="text" id="{{field}}" name="{{field}}" ng-model="::item[field].display_value" class="tc-row-input" ng-class="{'error': item[field].invalid}"
aria-invalid="{{item[field].invalid}}" />
</div>
<div ng-if="data.timecardInEditMode == item.sys_id && data.column_meta[field].editable && (field === 'project_time_category') && data.isProjectActive"
ng-class="{select2_field:(item['isProjectWork']) }">
<label class="sr-only" for="{{field}}">{{field}}</label>
<span ng-if="!(item['isProjectWork'])">${None}</span>
<input ng-if="(item['isProjectWork'])" type="text" id="{{field}}" name="{{field}}" ng-model="::item[field].display_value" class="tc-row-input"
ng-class="{'error': item[field].invalid}" aria-invalid="{{item[field].invalid}}" />
</div>
</div>
<div data-id="{{::item.sys_id}}" class="flex-item">
<a href="Javascript:void(0);" class="icon-ellipsis-vertical more-action-btn" popover-animation="true" uib-popover-template="'tcMoreActions'"
popover-animation="true" popover-placement="auto left" popover-trigger="outsideClick" popover-is-open="data.tcPopover{{item.sys_id}}"
popover-class="more-action-popover" ng-click="adjustPopover($event)" role="button" aria-label="${More Actions}"
uib-tooltip="${More Actions}" tooltip-placement="auto left" tooltip-append-to-body="true"
tooltip-is-open="data.moreActionTp{{item.sys_id}}" ng-mouseover="tooltipEnable($event,false)"></a>
</div>
</div>
</div>
<sp-paginator ng-if="pageSize <= total" total="total" page-size="pageSize" current="current"></sp-paginator>
</div>
</div>
</div>
</div>
<div ng-if="!data.list.length">
<div id="empty-state">
<div style="font-size:12px;text-align:center;margin-top: 50px;">${No Time Cards logged yet.}</div>
<div style="margin-top:30px;text-align:center;" ng-if="::data.canCreateTimecards">
<button type="button" class="btn btn-default" ng-if="data.canGenerateTimeCards" ng-click="generateTimecards()">${Generate Time Cards}</button>
<button type="button" class="btn btn-default" ng-click="copyFromPreviousTimesheet()" aria-haspopup="true">${Copy from previous Time Sheet}</button>
</div>
</div>
</div>
<sp-widget widget="data.modalInstance" ng-if="data.modalInstance"></sp-widget>
<pw-confirm-dialog data="data.confirmDialogOpts" ng-if="showConfirm"></pw-confirm-dialog>
</div>
Server -
