yvonnen's Profile
Rookie
5
Points

Questions
1

Answers
1

  • Rookie Asked on August 8, 2021 in SuiteScript.

    Hi all – I’ve found the answer to my own question and thought I might post it here in case it can help others down the line.

    You can use nlapiSubmitRecord to both submit AND update a current record, so you don’t need to do anything different between POST and PUT requests really (in terms of the fields – i.e. I don’t need to duplicate my code and then somehow slightly alter every single field call I want to update). Similarly, you can use setFieldValue to set new values/ update existing fields, instead of having to rely on any other NetSuite library. Just use nlapiLoadRecord to find existing records, instead of nlapiCreateRecord (for fairly obvious reasons), and pop an if statement into your function to decide if you’re going to create the record, or find the existing one to update.

    Thanks

    • 1254 views
    • 1 answers
    • 0 votes