Skip to content

Conversation

@zstromsodt
Copy link

@zstromsodt zstromsodt commented Oct 7, 2025

PR Description: A Client Script that hides the Start/Stop button on a table.

Pull Request Checklist

Overview

  • [X ] I have read and understood the CONTRIBUTING.md guidelines
  • [ X] My pull request has a descriptive title that accurately reflects the changes
  • [ X] I've included only files relevant to the changes described in the PR title and description
  • [ X] I've created a new branch in my forked repository for this contribution

Code Quality

  • [ X] My code is relevant to ServiceNow developers
  • [ X] My code snippets expand meaningfully on official ServiceNow documentation (if applicable)
  • [ X] I've disclosed use of ES2021 features (if applicable)
  • [ X] I've tested my code snippets in a ServiceNow environment (where possible)

Repository Structure Compliance

  • [X ] I've placed my code snippet(s) in one of the required top-level categories:
    • Core ServiceNow APIs/
    • Server-Side Components/
    • Client-Side Components/
    • Modern Development/
    • Integration/
    • Specialized Areas/
  • [ X] I've used appropriate sub-categories within the top-level categories
  • [X ] Each code snippet has its own folder with a descriptive name

Documentation

  • [X ] I've included a README.md file for each code snippet
  • [ X] The README.md includes:
    • Description of the code snippet functionality
    • Usage instructions or examples
    • Any prerequisites or dependencies
    • (Optional) Screenshots or diagrams if helpful

Restrictions

  • [ X] My PR does not include XML exports of ServiceNow records
  • [ X] My PR does not contain sensitive information (passwords, API keys, tokens)
  • [ X] My PR does not include changes that fall outside the described scope

@wiz0floyd wiz0floyd self-assigned this Oct 7, 2025
## How to Use
1. Create OnLoad client script (timeworkedhidetimer.js)
2. Adjust which table you want it on. In this case, it will be Incident table.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add a sentence or two about why this needs to be done with DOM manipulation instead of g_form or other oob methods? Otherwise looks good.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my understanding, this isn't possible using oob methods or g_form according to documentation I found. Happy to use those if there is a solution for it.

https://www.servicenow.com/community/developer-forum/automaticly-stop-time-worked-timer/m-p/1603232

https://servicenowguru.com/system-ui/pausetoggle-time-worked-field/

If DOM manipulation is illegal in the code snippets, I can close the pull request. I misunderstood the purpose of this project if that's the case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I think you're right that there's not a native method for this. I meant can you add some information in the readme and/or code comments stating that DOM Manipulation must be used for this. Just want to include extra context since DOM manipulation is usually not aligned with best practices.

@zstromsodt zstromsodt closed this Oct 8, 2025
@wiz0floyd
Copy link
Contributor

Please reopen once you add a note about DOM Manipulation being necessary for this specific use case :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants