
The NetSuite external ID attribute of a RecordRef provides a means to reference an object by its foreign key in an external database. You can set the external ID attribute during an add or update operation. In addition, External IDs are useful in maintaining client ID relationships and establishing relationships during a single import operation.
As you know, an External ID is used in NetSuite to associate a record with an external system—such as a payroll system or another method outside NetSuite. So, you'd use your external ID in NetSuite to connect to the ID that's within that external system. We have a client who has made extensive use of their external IDs for employee, location, and Department records. The problem was whether the client would create a new record and location. When they create the new site, there's no easy way to enter the External ID. Therefore, it would not get entered, which would cause problems with other processes that we have.
So, the only way to use NetSuite to enter an External ID is with a CSV import. You would have to export the data and create a CSV file. You can see the External ID or update the external IDs, save the CSV file, and then go in and create an import template to go through the import process. It’s a complex process and a little tedious. Therefore, most NetSuite Consultants are doing a safe search to show the External ID. The next step up from there is to see the External ID on the actual location form.
Most NetSuite consultants know how to create a custom record to display the External ID. You create an email and another record field, the record type location, give it a label, give it your ID 34, and text that you're not storing the value. Can your default team value be used as an External ID?
Let’s get you to this point where you can view the record, but if you go in and try to update it, say I want to save the record. Of course, there's no way to do it. After having a few issues with the client and the External ID not being added, I reached out to one of our senior sweet script developers and explained the problem. Then, within a few hours, I had a working script that would update the External ID for the location records. We have our own in-house team of developers; therefore, it's very easy for us to reach out to them, explain the problem in detail, and get a working script in the client sandbox to test and demonstrate to the client how it works. With approval, we can move all those scripts into their production environment and custom fields, and then they will have a working functional script. The client has been pleased with the scripts for updating their external IDs over the last year.
One thing to note is that,t as of this recording in July of 2023, this script does work. However, in the future, NetSuite could put up blocks in the code and prevent this functionality. I can show you an image of the script to show you what we're using. I have blurred out the functionality so that it cannot be duplicated. This is a very complex script, and everything must be exact between the script and the custom fields. It really should be done by a professional. We don't want someone to try to grab a screengrab of our script from this video and implement it. That would be very problematic.
You also need a separate script for each record type. Whether it's an employee or a location, it needs a separate script. Department or other records would have their own separate script as well. It can be quite challenging to get all that set up. As you see here, this record type is specific to location. Therefore, that's just the job status.
Now I can deploy the script. I had our test script in here, and I just turned it off to show you how it doesn't work, or how NetSuite typically works without the script. I'm deploying the script in test mode. So now, if I go back to the location and edit it, I want to make the External ID 887. I'll add it and save the record. And as you see now, it's been saved 887. If we go back out here to the list and press refresh, it now shows as 887 and says we have production. Since we have the script in here, we want to add an external ID for this production location. This location, External ID is 999.
As a highly accredited NetSuite Solution Provider, ScaleNorth is well-positioned to help you with the full scope of your NetSuite customization needs. If you require more NetSuite assistance, contact ScaleNorth today.
Chris Emory is a versatile and accomplished IT professional with 20 years of experience in information systems and functional consulting. Chris has a wealth of experience as a NetSuite Expert and holds the NetSuite Administrator and SuiteFoundation credentials.