Discussions
Join us for complimentary one-day events around the world and step into a future fueled by AI and limitless potential. Explore new breakthroughs, sharpen your skills, and connect with experts who are shaping what’s next. Experience bold keynotes, interactive learning, and connections that span the global NetSuite community. Discover what's next at SuiteConnect Tour 2026.
Working with custom records
Hi,
I have a script that does a search for a custom record based on a value of a custom field after a customer record has been created.
It used this value to lookup a custom record to see if it already exists.
Here is the code:
function CheckIfTHisCardNumberExists()
{
var currentRecord;
currentRecord = nlapiGetNewRecord();
var enteredcardno = currentRecord.getFieldValue('custrecord_linked_card_no');
var searchresults = nlapiSearchRecord('customrecord17', null, null, null);
var totalsize = searchresults.length;
for (var i = 0; i < totalsize; i ++)
{
var searchresult = searchresults[i];
var curcardnum = searchresult.getValue('custrecord_mship_mem_2');
alert("curcardnum is " + custrecord_mship_mem_2);
if (curcardnum == enteredcardno)