Coder Social home page Coder Social logo

servicenowdevprogram / code-snippets Goto Github PK

View Code? Open in Web Editor NEW
238.0 26.0 502.0 15.24 MB

ServiceNow's Code Snippets community repository, managed by the Developer Program and the sndevs community.

Home Page: https://github.com/ServiceNowDevProgram/Hacktoberfest

JavaScript 91.37% HTML 4.77% CSS 1.07% SCSS 2.80%
hacktoberfest servicenow hacktoberfest2021 hacktoberfest-accepted hacktoberfest2022 hacktoberfest2023

code-snippets's Introduction

Code Snippets Banner

Welcome to ServiceNow's Code Snippets community repository, managed by the Developer Program and the sndevs Slack community.

Inside this repository, you will find community submitted code-snippets and their variants for different use-cases.

Note: ServiceNowDevProgram has many repositories that can be imported directly into ServiceNow, this is not one of them; This repository is meant to be edited directly in GitHub or any other Git-enabled IDE like VS Code.

Disclaimer

Please note the following:

  1. Community-Sourced Code: The code found in this repository is contributed by members of the community and has not been vetted or officially endorsed by the repository owners.

  2. Use at Your Own Risk: Users are advised to exercise caution and thoroughly review the code before implementing it in their ServiceNow instances. We strongly recommend a comprehensive review to ensure the code aligns with your specific requirements and security standards.

  3. Reporting Mistakes and Issues: If you come across any mistakes, issues, or improvements in the code, we encourage you to report them and consider contributing to the repository by submitting corrections or enhancements.

  4. No Warranty or Support: This repository is provided as-is, without any warranties or guarantees. It does not come with official support from the ServiceNow team or the repository owners.

By using the code from this repository, you acknowledge that you have read and understood this disclaimer. Your use of the code is at your own discretion and risk.

We appreciate your participation and contributions to this community-driven project. Let's collaborate to make it a valuable resource for ServiceNow developers and enthusiasts.

๐Ÿ””๐Ÿ””๐Ÿ””
CONTRIBUTORS must follow all guidelines in CONTRIBUTING.md or run the risk of having your Pull Requests labeled as spam.
๐Ÿ””๐Ÿ””๐Ÿ””

We invite you to contribute!

To contribute, just follow these steps:

  1. Fork this repo (you get a point just by forking!)
  2. Create a new branch on your fork
  3. Add/Update the repo
  4. Submit a pull request!

That's it! More detailed contribution instructions can be found here

Leaderboard

Looking for the old leaderboard? We've moved the leaderboard to the overarching Hacktoberfest repository and have expanded its scope to all participating projects.

code-snippets's People

Contributors

23thom avatar 404paige avatar ajcooper72 avatar alikuttyka avatar allenandreas avatar anillande90 avatar ashu759 avatar danr2c2 avatar earlduque avatar eriemer1 avatar hrobarikt avatar iar42 avatar irston avatar ishaanshoor avatar jonahpiascik avatar kmohit2809 avatar lacah avatar litwilly avatar mr-swann avatar mrchrise avatar niamccash avatar oasif avatar ovarn avatar pranavbhagat18 avatar r3j3nt avatar radhe-manasa avatar rahmanm avatar rmedved84 avatar sn-ajb avatar sumanthdosapati avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

code-snippets's Issues

Fix "Fix Scripts" folder

  • remove .DS_Store file from the parent folder
  • break up each function into it's own .js file

make sure to reference this issue if you submit a pull request to fix this,

Add "invitations" check to "assign to me" workflow

In ServiceNow we just have an "approver" checkbox, but that just initiates the collaborator invitation. We need to add a stop to the workflow:

  1. do we know their github username?
  2. if yes, are they an approver in servicenow?
  3. if yes, are they still on the invitation list?
  4. if no, allow assignment

onChange client script defined on a MRVS is not working as expected

function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}

var project = g_form.getReference('project_name', populateProjectNumber); 

}

function populateProjectNumber(project) {
g_form.setValue('project_number', project.u_project_number);
}

window == null to determine if in service portal not working

I've seen a few references to using window == null when trying to determine if in the platform or service portal. This only seems to work in my Rome PDI if isolate script is set to false

if(window == null){ // For Service Portal
var url = top.location.href;
var value = new URLSearchParams(url).get('sysparm_id'); //provide the parameter name
console.log(value);
}
else{ //For Native UI
var glideURL = new GlideURL();
glideURL.setFromCurrent();
var id = glideURL.getParam("sysparm_id"); // provide the parameter name
console.log(id);
}

I've found a workaround by using a try/catch block like the following:

https://github.com/litwi1rm/code-snippets/blob/63e1a015cecc56611aec8e03523e4fc2f631e555/Catalog%20Client%20Script/Clear%20all%20fields/script.js#L11-L24

Has anybody else ran into this?

Create a licensing file

Especially for starcoder reasons, if we open the license for this repository then it will only make the ServiceNow LLMs even stronger in the future.

Earl has to verify with legal first.

Get people's input on scores

Title Point
A commit has been pushed 1
An issue has been closed 2
A pull request has been opened 5
A pull request was closed but not merged 1
A new fork has been created 1
An issue has been opened 2

Replace standard Window methods with GlideModal equivalent

It is not recommended to use the standard Javascript Window methods for pop-ups. Let's get them replaced with GlideModal (or spModal for portal), i.e.:

Confirm

Alert

Found more? Feel free to add to the list!

Had a merged PR that fixes one or more of these? Tick 'em off!

Update documentation to state that this is not a servicenow application repository

ServiceNowDevProgram has many repositories that can be imported directly into ServiceNow, this is not one of them; This repository is meant to be edited directly in GitHub or any other Git-enabled IDE like VS Code.

the root readme is overwritten automatically so changes to the readme should be done on .github/templates/rootreadmetemplate.md. Pull request changes to this file will only be approved if attached to this issue.

Cannot clone the repository after forking due to error

Hello,

I am not able to clone the repository after I have forked the project. Possibly a folder with incorrect name?
See error below:

Cloning into 'code-snippets'...
remote: Enumerating objects: 10527, done.
remote: Counting objects: 100% (1241/1241), done.
remote: Compressing objects: 100% (484/484), done.Receiving objects: 1% (106/10527)
remote: Total 10527 (delta 895), reused 1039 (delta 750), pack-reused 9286
Receiving objects: 100% (10527/10527), 13.70 MiB | 7.03 MiB/s, done.
Resolving deltas: 100% (4976/4976), done.
error: invalid path 'Background Scripts/Move Customer Updates /moveCustomerUpdates.js'
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.