We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Button is throwing an error in ATF : Change Management

Devansh00
Tera Contributor

Hi all,

 

I am creating ATF for change management for custom use cases when i am clicking an Request Approval button it is giving me an error after clicking the button. attaching screenshot for reference.

any solution ?

 

Devansh00_0-1784050530057.png

 

1 REPLY 1

Tanushree Maiti
Tera Patron

Hi @Devansh00 ,

 

In your ATF script , somewhere you have used replace() function which is not supported by Servicenow.

 

The error "Cannot read properties of null (reading 'replace')" occurs when your ServiceNow client-side code executes a .replace() string function on a variable or field that contains no data or evaluates to null

 

For example:

var value = null;

var result = value.replace("old", "new");

 

Change the replace() by some supported function .

 

You ca share the code snippet as well .

 

 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti