Service Portal Errors on Submit and Record Producer Failures Due to DateTime Scripts and Duplicate VariablesIssue <!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } This article covers two related Service Portal issues that cause request submission failures: NullPointerException or GlideDateTime errors triggered by custom server scripts referencing DateTime fields, and record producers that fail to create records due to duplicate variables. Both issues surface as submission errors in the Service Portal and can prevent requests from being created. Symptoms<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Submission errors in Service Portal such as Evaluator: java.lang.NullPointerException.Widgets may fail on the page, for example Ticket conversation failing.Log entries referencing GlideDateTime methods, for example:com.glide.glideobject.GlideDateTime.addSeconds(GlideDateTime.java:1172)SEVERE *** ERROR *** performing addSeconds with invalid GlideDateTimeRecord producer submits but does not create a record; a NullPointerException appears in logs after Madrid Patch 6.Behavior may be intermittent or reproducible immediately after a change to business rules, record producers, or variables. Release<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } All releases Cause<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Root Causes Custom Business Rule or Script referencing DateTime type fields incorrectly or operating on null/invalid GlideDateTime values. Scripts that call methods such as addSeconds on an uninitialized or null GlideDateTime will throw exceptions and break the submission flow.Duplicate Variables on Record Producer where two variables share the same name (variable names are case insensitive). An inactive duplicate variable with the same name can still cause a NullPointerException and prevent record creation. Resolution<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Resolution and Detailed Steps A. Fixing DateTime Script Errors Identify the failing script Tail the instance logs while reproducing the error to capture stack traces and timestamps.Look for recent changes to business rules, script includes, or other server-side scripts that reference DateTime fields. Check the Updated field on business rule records to find recent edits. 2. Isolate the business rule or script Temporarily deactivate suspect business rules or script includes one at a time in a non-production environment to confirm which script causes the error. 3. Correct the script logic Ensure DateTime fields are validated before calling GlideDateTime methods. Example checks: confirm the field is not null and is a valid GlideDateTime instance before calling addSeconds, getNumericValue, or similar methods.Use defensive coding patterns: initialize GlideDateTime objects, wrap operations in try/catch where appropriate, and log meaningful errors. 4. Test and re-enable After fixing the script, re-enable the business rule and reproduce the submission flow in Service Portal to confirm the error is resolved. B. Fixing Record Producer Duplicate Variable Issue 1. Identify duplicate variables Open the record producer and review its variable list. Sort or search by Name to find duplicates. Remember, variable names are case-insensitive. 2. Remove or rename duplicates Delete the inactive duplicate variable with the same name, or rename variables so each has a unique name. Do not rely on an inactive variable to avoid conflicts—remove duplicates entirely. 3. Retest the record producer Submit the record producer from the Service Portal and confirm that a record is created and no NullPointerException appears in the logs. Verification Checklist: Preventive Actions and When to Contact Support Reproduce the submission in Service Portal after changes and confirm no exceptions appear in logs.Confirm widgets that previously failed (for example, Ticket conversation) render and function normally.Confirm that record producers create records successfully after duplicate variables are removed. Preventive Actions Apply defensive checks in all server-side scripts that reference DateTime fields.Enforce unique variable naming conventions for record producers; treat variable names as case-sensitive.Use change control and code review for business rules and record producer updates; test in a sub-production instance before production deployment. When to Contact Support Open a ServiceNow Support case if you cannot identify the offending business rule or duplicate variable, or if errors persist after applying the fixes. Provide: instance name, exact error messages and stack traces, affected record producer or business rule sys_ids, recent change history, and reproduction steps.