Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

359
Views
Netsuite - REST API - How to create new Entry record with Token Based Authentication (TBA) - (in Python)

This is a follow up to the successful call using Netsuite Token Based Authentication (TBA) REST webservice,

I would like to get some guidance on how to create a NEW ENTRY RECORD.

Here is my custom type record entry list (please see screenshot)

enter image description here

https://gist.github.com/axilaris/4386c3537d04737d3775c156562b7545 <-- here is the python code for the TBA that has worked successful. I would like to know how to construct the next step on how to create a new entry.

This is a custom record with an ID like this customrecord1589

FYI - here is my other question on query Netsuite - REST API - Making query with Token Based Authentication (TBA) - (in Python) But this question would be creating a new entry record

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Within your restlet you need to use the N/record module to create a new custom record, here is what is should look similar to:

/**
 * @NApiVersion 2.1
 * @NScriptType Restlet
 */
define(["N/log", "N/record"], function (log, record) {
    function post(context) {
        return JSON.stringify(createCustomRecord(context));
    }

    function createCustomRecord(context) {
        let success = true;
        try {
            let custRec = record.create({
                type: "customrecord1589",
                isDynamic: true,
            });
            //Set one or more fields here
            custRec.setValue({
                fieldId: "custrec123",
                value: context.custrec123,
            });
            custRec.save();
        } catch (e) {
            log.error("Error creating record", e);
            success = false;
        }
        return { success: success };
    }

    return {
        post: post,
    };
});
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!