Discussions
Join the NetSuite community to innovate, connect, and discover what’s next.
SuiteWorld brings thousands of innovators, builders, and leaders together to learn, connect, and shape what’s next. This October, explore how to build a stronger foundation for growth through inspiring keynotes, major product reveals, hands-on sessions, and unforgettable moments—all in one place for our biggest event of the year. Register now
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)