ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

NSOA

by rmorrissey23 ST2/ST3

No description provided

Details

Installs

  • Total 57
  • Win 38
  • OS X 11
  • Linux 8
Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5
Windows 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
OS X 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
bitbucket.​org

sublime-nsoa-user-scripting

A Sublime Text package containing helpful tools for NetSuite OpenAir User Scripting.

New in this Release

Version 2.0 of the NSOA User Scripting package includes some major enhancements, including the ability to generate auto-completions directly from your account specific WSDL URL, as well as a handy right-click context menu for viewing and pasting API object fields directly from your WSDL. Lastly, you can open PDF documentation guides quickly from the command palette, right-click context menu, or the Tools > NSOA menu.

Installation

Package Control

You can install this package using Package Control from wbond.net.

  • Press ctrl+shift+p (Windows/Linux) or command+shift+p (OS X) to bring up the Command Palette (or use Tools > Command Palette menu)
  • Type to search for the Package Control: Install Package command
  • Search packages for NSOA and hit enter to install
  • NOTE: You may need to restart in order to use this package

Manual

Clone or download the contents of this repo into your Sublime Text Packages folder.

  • OS X: ~/Library/Application\ Support/Sublime\ Text\ 3/Packages
  • Windows: %APPDATA%\Sublime Text 3\Packages
  • Linux: ~/.config/sublime-text-3/Packages

After Installing…

After installing this package, make sure you configure your User settings file. The most important piece of this is to set your server and port settings, which are used to create the generic WSDL URL. If unset, the package will fall back on the production server WSDL URL (Note: if you develop on QA or sandbox, this may mean that your WSDL data will not contain the most recent API objects and fields).

{
    // This should hold the server you are connecting to.
    // Valid options are: "production", "sandbox", "demo", "qa"
    "server": "",

    // This optionally holds the port used to connect to
    // the above server (e.g. 1443).
    "port": ""
}

What's Included

Screenshots

Quick Tour: Commands

nsoa_commands.gif

Quick Tour: Completions

nsoa_completions.gif

Quick Tour: Account-Specific WSDL

nsoa_account.gif

Quick Tour: Context Menu

nsoa_context.gif

Theme: Centurion

Color Scheme: Tomorrow Night

Font: Source Code Pro

Syntaxes

  • JavaScript (NSOA)

Commands

  • NSOA: Load Generic WSDL
  • NSOA: Load Account-Specific WSDL
  • NSOA: Open Quick Reference Card
  • NSOA: Open SOAP API Guide
  • NSOA: Open User Scripting Guide
  • NSOA: Remove All WSDL Data

Completions (Default)

  • NSOA.context
    • remainingTime
    • remainingUnits
    • isTestMode
  • NSOA.form
    • error
    • getAllValues
    • getLabel
    • getValue
    • getOldRecord
    • getNewRecord
  • NSOA.meta
    • alert
    • log
    • log-debug
    • log-error
    • log-fatal
    • log-info
    • log-trace
    • log-warning
  • NSOA.wsapi
    • add
    • delete
    • disableFilterSet
    • modify
    • read
    • upsert
    • whoami
    • enableLog
    • remainingTime

Snippets

// attribute
{
    name: "${1:limit}",
    value: "${2:100}"
}

// function
function ${1:useCamelCase}(type) {
    try {

        $0

    } catch(e) {
        NSOA.meta.log('error', 'Try/catch error: ' + e);
    }
}

// header
/**
 * Copyright NetSuite, Inc. 2014 All rights reserved.
 * The following code is a demo prototype. Due to time constraints of a demo,
 * the code may contain bugs, may not accurately reflect user requirements
 * and may not be the best approach. Actual implementation should not reuse
 * this code without due verification.
 *
 * ${2:Short description of script file}
 *
 * Version    Date            Author           Remarks
 * 1.00       ${1:@date }     Ryan Morrissey
 *
 */


// read_error_check
function readErrorCheck(readResult) {
    if (!readResult || !readResult[0]) {
        NSOA.meta.log('error', 'No read objects returned.');
        return;
    } else if (readResult[0].errors !== null && readResult[0].errors.length > 0) {
        readResult[0].errors.forEach(function(err) {
            var fullError = err.code + ' - ' + err.comment + ' ' + err.text;
            NSOA.meta.log('error', 'Error: ' + fullError);
        });
        return;
    } else {
        return readResult;
    }
}

// read_request
{
    type       : "${1}",
    method     : "${2:equal to}",
    fields     : "${3}",
    attributes : [${4}],
    objects    : [${5}]
}

// update_error_check
function updateErrorCheck(updateResult) {
    if (!updateResult || !updateResult[0]) {
        NSOA.meta.log('error', 'No update objects returned.');
        return;
    } else if (updateResult[0].errors !== null && updateResult[0].errors.length > 0) {
        updateResult[0].errors.forEach(function(err) {
            var fullError = err.code + ' - ' + err.comment + ' ' + err.text;
            NSOA.meta.log('error', 'Error: ' + fullError);
        });
        return;
    } else {
        return updateResult;
    }
}

License

LICENSE

Changelog

CHANGELOG

Issues

You can log issues from the menu on the left, or by clicking here.