Customer IDs can occasionally contain invisible leading characters such as tabs, spaces, carriage returns, or line feeds usually introduced through CSV imports, integrations, or manual copy-and-paste. These hidden characters can cause duplicate-looking records, failed searches, matching problems in integrations, and unexpected errors when users enter customer IDs.
Use the following SuiteQL query to identify customer records whose entityid begins with a non-visible character. This lets administrators pinpoint and correct problematic values before they affect reporting, workflows, integrations, or user operations.
Sample Query
SELECT
c.id, /* Internal ID of the customer record */
c.entityid, /* Customer ID / Name value */
/* Return the ASCII code for the first character in entityid */
ASCII(c.entityid) AS first_character_ascii,
/*
Convert common ASCII codes for hidden leading characters
into an administrator-friendly description.
*/
CASE
WHEN ASCII(c.entityid) = 9 THEN 'Tab'
WHEN ASCII(c.entityid) = 10 THEN 'Line feed'
WHEN ASCII(c.entityid) = 13 THEN 'Carriage return'
WHEN ASCII(c.entityid) = 32 THEN 'Leading space'
ELSE 'Normal visible character'
END AS first_character_description
FROM
customer c /* Customer record table */
WHERE
c.entityid IS NOT NULL /* Exclude customers without a Customer ID */
ORDER BY
c.entityid; /* Sort results alphabetically by Customer ID */
To easily execute a SuiteQL query, see NetSuite Admin Tip | Running SUITEQL Using a Suitelet
DISCLAIMER: The sample code described herein is provided on an "as is" basis, without warranty of any kind, to the fullest extent permitted by law. Oracle + NetSuite Inc. does not warrant or guarantee the individual success developers may have in implementing the sample code on their development platforms or in using their own Web server configurations.
Oracle + NetSuite Inc. does not warrant, guarantee or make any representations regarding the use, results of use, accuracy, timeliness or completeness of any data or information relating to the sample code. Oracle + NetSuite Inc. disclaims all warranties, express or implied, and in particular, disclaims all warranties of merchantability, fitness for a particular purpose, and warranties related to the code, or any service or software related thereto.
Oracle + NetSuite Inc. shall not be liable for any direct, indirect or consequential damages or costs of any type arising out of any action taken by you or others related to the sample code.
We’d love to hear how you integrate SuiteQL into your NetSuite processes! Share your insights and experiences in the NetSuite Admin Corner.