Showing posts with label JavaScript. Show all posts
Showing posts with label JavaScript. Show all posts

Tuesday, September 3, 2019

Business Rules in ServiceNow

Business Rules :

  • Business rules are the server side processing objects.  
  • Can be configured to trigger on create/read/update/delete operations into a table.
  • Can be configured to execute before/after/async of any of the the above operations.
  • Before rules are generally used for data enrichment, validation.
  • After rules are generally used to configure notifications, perform upsert operations into a related table.
  • Async rules are generally used for outbound integrations, heavy processing logic which could  otherwise impact user experience. 
  • Display rules can be configured to pass on values from server side to client side scripts to eliminate the round trips.
  • Query rules can be configured to add additional default conditions to all the query statements performed on a table.




Objects : 

current  :  represents the current state of the record that is being processed.   Available in before, after, query, display, async business rules.

previous : represents the previous state of the record that is being processed. Available in before, after business rules.

g_scratchpad :   represents an object which can be loaded with key value pairs from server side to access at client side. Available in display business rules.

Avoid :

  •  current.update()  in before business rules. Could lead to infinite loop of rule execution without  proper conditions. 
  •  outbound integration calls in before/after business rules.  This impacts user experience.
  •  writing lengthy scripts in advanced business rules . Use script includes instead.
  •  Avoid global business rules. Use script includes where possible. 
  • Avoid circular updates among related tables.  i.e Business rules on table A updating table B, and Business rules on table B, updating table A.

Stuck with ? :


Unique key violation detected by database :   Could be because of current.update() in before business rules, or circular updates.

Workflow execution order :  Workflows run before the insertion into table and after before business rules with order <= 1000.  so, adjust the order if needed.

Empty journal fields :  values of journal fields such as work_notes, comments are not available in an after business rules, use current.work_notes.getJournalEntry(1) instead. 

Activities being duplicated : Could be because of current.update() in before business rules, or circular updates between related tables.


Here are the related articles on ServiceNow






Saturday, July 13, 2019

Getting Started with Javascript


Why Javascript ?


Javascript is just everything these days in Software Development.  Javascript used to be all over the browser and respond to user events such as form loading, form filling, form submission.

With the introduction of Node the dynamics have changed , now javascript can run not only on  browser but on the servers that serving the content. So,  If you are thinking, what I am thinking then we both are exactly right, Javascript is everywhere.





Career Options:


With such massive spread footprint of javascript, you have ton of options that you can make career out of.

  • Front End Developer :   Frameworks such as React, Angular Js are widely being used in organizing, stying most of the http(s) content, so pick your framework to start the journey.
    1. Reacthttps://reactjs.org/
    2. Angular Js: https://docs.angularjs.org/api

  • Back End Developer:  Node js developers are of high demand and the fact that this environment is being well received and supported by major cloud players such as AWS, Google, Microsoft in their serverless stack/applications, you will be winner if you know Node js.   There are other serverside javascript environment such  rhino, if you want to venture out and explore the possibilities. You could always use official docs https://nodejs.org/en/docs/

  • Full Stack Developer :   Having familarity with the front end, back end worlds and knowledge in atleast framework of each side Full stack developer is a god like person.   Remember its the hands on expereince that matters , so if you are an expert in either front end or back end development eagarly lookout for opportunities or leads in your current organisation or outside of your organisation. It will pay off for sure down the line.


 I find below Node School  website particularly useful with its exercise oriented learnings. 




ITIL V4 foundation exam pattern

What is the purpose of ITIL V4 foundation? The purpose of ITIL V4 foundation is to introduce readers to the management of modern IT-enable...