Discussions

Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Update your Profile with your Support type to get your Support Type badge.
Expand your NetSuite knowledge by joining our Ask A Guru Live sessions. RSVP on this event now.
Don't miss out on our Question of the Week! You only have until tomorrow, September 11, 2025, 2PM ET to comment your answers and earn rewards! Click here for more details.
Uncover the power of data with the Analytics Hub —your ultimate guide to mastering NetSuite Saved Searches and Reports. Simplify the complex and unlock your organization's true potential. Dive into the Analytics Hub now and soar to new heights!
NetSuite 2025.2 Release Notes - This document summarizes the changes to NetSuite between 2025.2 and the previous release.
To help you get the most out of your 2025.2 Release Preview account, review the topics outlined in the 2025.2 Release Preview Guide.
SuiteWorld October 6 - 9, 2025: Agenda Builder is live!

Read on for the latest updates including:
• Agenda Builder launch
• SuiteWorld On Air registration
• New NetSuite Prompt Studio Contest
• And more!

Check out this thread to learn more!

Kilimanjaro - how can we extend validation patterns

edited Jun 2, 2025 2:43PM in Ask A Guru 5 comments

Hello! We use SuiteCommerce Advanced Kilimanjaro and I have a question regarding being able to extend the Backbone.Validation.patterns fields. Ultimately I would like to call a new pattern we're creating from within code as such; Backbone.Validation.patterns.customPattern.test(<string to test>).

In the third_parties directory there is the backbone-validation module that includes backbone-validation.js, which is where the base logic is for validation. In the suitecommerce/BackboneExtras module there's Backbone.Validation.patterns.js, which looks like it's an extension to the base .patterns object:

define('Backbone.Validation.patterns'
,	[	'Backbone'
	,	'underscore'
	,	'Backbone.Validation'
	]
,	function (
		Backbone
	,	_
	)
{
	'use strict';

	_.extend(Backbone.Validation.patterns,
	{
		// Same as email but is more restrictive and matches the same emails as the Netsuite backend UI
	    // Source: https://system.netsuite.com/javascript/NLUtil.jsp__NS_VER=2014.1.0&minver=154&locale=en_US.nlqs
	  //    (Search for NLValidationUtil_SIMPLE_EMAIL_PATTERN)
		email: /^[-a-z0-9!#$%&'*+/=?^_`{|}~]+(?:\.[-a-z0-9!#$%&'*+/=?^_`{|}~]+)*@(?:[a-z0-9]+(?:-+[a-z0-9]+)*\.)+(?:xn--[a-z0-9]+|[a-z]{2,16})$/i

		//This validation is less restrictive than standard and matches with the used in Netsuite backend
	,	netsuiteUrl: /^(https|http|ftp|file):\/\//

	,	netsuiteFloat: /^-{0,1}([0-9])+(\.{1}[0-9]+)?$/

	,	netsuiteInteger: /^-{0,1}([0-9])+$/
		//Allow numbers bettwen 000.00 and 000100.00 ending with optional %
	,	netsuitePercent: /^0*((([0-9]{1,2})(\.[0-9]{1,2})?%?$)|(100(\.0{1,2})?%?$))/

		//Allow any character 7 or more times (this is the validation that the netsuite backend form does on phone type fields)
	,	netsuitePhone: /^.{7,}$/

	});

	return Backbone.Validation.patterns;
});

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!

Leaderboard

Community Whiz

Quarter 3 (Jul-Sep 2025)

This Week's Leaders

This Month's Leaders

All Time Leaders