Namespace: NetsuiteToolkit

NetsuiteToolkit

Source:

Classes

SublistProcessor

Namespaces

RecordProcessor
SublistProcessor

Methods

<static> deleteRecord(record_type, interalid) → {number}

Requests a record be deleted from NetSuite's database by id (internal_id in NetSuite parlance)
Parameters:
Name Type Description
record_type string The String representing a record type
interalid string The String representing a NetSuite internal_id
Source:
Returns:
The number representing the internalid of the record deleted
Type
number

<static> formatException(exception) → {object}

Returns a formatted reply object based off of a given exception.
Parameters:
Name Type Description
exception error The Error object of the given exception
Source:
Returns:
The formatted reply object generated from the exception
Type
object

<static> formatReply(params, result, exception) → {object}

Returns a formatted reply object using a given set of params, result and possible exception
Parameters:
Name Type Description
params object The object holding the params of a request
result object The object containing the result of the request
exception error The error object of a raised exception
Source:
Returns:
The formatted reply object
Type
object

<static> getIdFromRecord(record) → {number}

Removes a line item at a given index for a given sublist field.
Parameters:
Name Type Description
record nlobjRecord An instance of nlobjRecord
Source:
Returns:
The number representing the record id
Type
number

<static> getLineItemCount(record, sublist_name) → {number}

Fetches the line item count for a given NetSuite sublist.
Parameters:
Name Type Description
record nlobjRecord The NetSuite record object
sublist_name string The String representing the NetSuite sublist
Source:
Returns:
The line item count for the sublist.
Type
number

<static> getLineItemValue(record, sublist_name, index, field_name) → {number}

Fetched the value of a line item in a given sublist for a given field.
Parameters:
Name Type Description
record nlobjRecord The NetSuite record object
sublist_name string The String representing the NetSuite sublist
index number The Number of the sublist index
field_name string The string representing the name of the field
Source:
Returns:
The value of the filed on the given sublist at the given index
Type
number

<static> initializeRecord(record_type) → {null}

Requests a newly initialized record from NetSuite.
Parameters:
Name Type Description
record_type string The String representing a record type
Source:
Returns:
Type
null

<static> insertLineItem(record, sublist_name, index) → {null}

Inserts a line item into a sublist on a given record.
Parameters:
Name Type Description
record nlobjRecord The NetsuiteRecord object
sublist_name string The String representing the NetSuite sublist on the record
index number The Number of the sublist index to be updated
Source:
Returns:
Type
null

<static> loadRecord(record_type, interal_id) → {null}

Requests a record from NetSuite's database by id (internal_id in NetSuite parlance)
Parameters:
Name Type Description
record_type string The String representing a record type
interal_id string The String representing a NetSuite internal_id
Source:
Returns:
Type
null

<static> removeLineItem(record, sublist_name, index) → {null}

Removes a line item at a given index for a given sublist field.
Parameters:
Name Type Description
record nlobjRecord The NetSuite record object
sublist_name string The string representing the name of the sublist field
index number The number of the sublist index
Source:
Returns:
Type
null

<static> searchColumn(field, join, summary) → {nlobjSearchColumn}

Removes a line item at a given index for a given sublist field.
Parameters:
Name Type Description
field string The string representing the name of the record field
join string The name of a field to join
summary string The summary of the column
Source:
Returns:
A new instance of nlobjSearchColumn
Type
nlobjSearchColumn

<static> searchFilter(field, join, value1, value2) → {nlobjSearchFilter}

Removes a line item at a given index for a given sublist field.
Parameters:
Name Type Description
field string The string representing the name of the record field
join string The name of a field to join
value1 string The string representing the value for comparison
value2 string The string representing the second value for comparison
Source:
Returns:
A new instance of nlobjSearchFilter
Type
nlobjSearchFilter

<static> searchRecord(record_type, search_id, search_filters, search_columns) → {array}

Removes a line item at a given index for a given sublist field.
Parameters:
Name Type Description
record_type string The string representing the record type
search_id string The string representing the search id
search_filters array The array containing a set on nlobjSearchFilter objects
search_columns array The array containing a set on nlobjSearchColumn objects
Source:
Returns:
The array containing the results of the search
Type
array

<static> setFieldValue(record, field_name, value) → {null}

Mutates an arbitrary field value on a NetSuite record.
Parameters:
Name Type Description
record nlobjRecord The NetSuite record object
field_name string The String representing the field to mutate
value value The String representing the value to replace
Source:
Returns:
Type
null

<static> setLineItemValue(record, sublist_name, index, field_name, value) → {null}

Mutates the value of a line item in a given sublist for a given field.
Parameters:
Name Type Description
record nlobjRecord The NetSuite record object
sublist_name string The String representing the NetSuite sublist
index number The Number of the sublist index
field_name string The string representing the name of the field
value string The string representing the value of the field
Source:
Returns:
Type
null

<static> submitRecord(record, do_sourcing, ignore_mandatory) → {null}

Requests that Netsuite write a given record to it's database.
Parameters:
Name Type Description
record nlobjRecord The NetSuite record object
do_sourcing boolean Enable or disable sourcing
ignore_mandatory boolean Recognize or ignore mandatory fields
Source:
Returns:
Type
null

<static> transformRecord(source_type, internalid, result_type, values) → {null}

Requests a record from NetSuite's database by id (internal_id in NetSuite parlance)
Parameters:
Name Type Description
source_type string The String representing a source record type
internalid string The String representing the internalid of the source record
result_type string The String representing a result record type
values object The object containing set of values to be populated onto the transformed record
Source:
Returns:
Type
null