| Option name | Type | Description |
|---|---|---|
| config | NetSuite.Configuration |
A service client through which requests are sent.
var Service = module.exports = function Service(config) {
this.config = config;
};
| Option name | Type | Description |
|---|---|---|
| [skipDiscovery=false] | Boolean | Don't try to discover WSDL url |
Initialize this service client with given config.
Service.prototype.init = function(skipDiscovery) {
return this.config.createConnection(skipDiscovery);
};
| Option name | Type | Description |
|---|---|---|
| recordRef | NetSuite.Records.RecordRef |
result description:
result.readResponse.status {String} Operation status. Contains more details on errors.result.readResponse.status.$attributes.isSuccess {String} Whether op was successful. String values of 'true' or 'false'[result.readResponse.status.statusDetail] {StatusDetail[]} Status details on error.result.readResponse.record {Record} The actual record. Its type is dependent on the given recordRef.type
Service.prototype.get = function(recordRef) {
assertConnection(this);
var soapObj = Serializer.serialize(recordRef);
var get = denodeify(this.config.client.get);
return get(soapObj);
};
| Option name | Type | Description |
|---|---|---|
| recordType | String | from `GetAllRecordType` enumeration in `coreTypes.xsd` |
Note that not all record types work with the getAll operation. Supported types
are listed in the GetAllRecordType enumeration in coreTypes.xsd.
result description:
result.getAllResult.status {String} Operation status. Contains more details on errors.result.getAllResult.status.$attributes.isSuccess {String} Whether op was successful. String values of 'true' or 'false'[result.getAllResult.status.statusDetail] {StatusDetail[]} Status details on error.result.getAllResult.recordList {Record[]} The actual records. Their types are dependent on the given recordRef.typesresult.getAllResult.totalRecords {Number}
Service.prototype.getAll = function(recordType) {
assertConnection(this);
var param = {
record: {
recordType: recordType
}
};
var getAll = denodeify(this.config.client.getAll);
return getAll(param);
};
| Option name | Type | Description |
|---|---|---|
| recordRefs | NetSuite.Records.RecordRef[] | array of RecordRefs |
result description:
result.readResponseList.status {String} Operation status. Contains more details on errors.result.readResponseList.status.$attributes.isSuccess {String} Whether op was successful. String values of 'true' or 'false'[result.readResponseList.status.statusDetail] {StatusDetail[]} Status details on error.result.readResponseList.readResponse {Record[]} The actual records. Their types are dependent on the given recordRef.types
Service.prototype.getList = function(recordRefs) {
assertConnection(this);
var soapObj = Serializer.serialize(recordRefs);
var getList = denodeify(this.config.client.getList);
return getList(soapObj);
};
| Option name | Type | Description |
|---|---|---|
| searchRecord | NetSuite.Search.EmployeeSearchBasic,Object |
result description:
result.searchResult.status {String} Operation status. Contains more details on errors.result.searchResult.status.$attributes.isSuccess {String} Whether op was successful. String values of 'true' or 'false'[result.searchResult.status.statusDetail] {StatusDetail[]} Status details on error.result.searchResult.pageIndex {Number} one basedresult.searchResult.pageSize {Number}result.searchResult.recordList.record {Record[]} The actual records. Their types are dependent on the search typeresult.searchResult.searchId {String}result.searchResult.totalPages {Number}result.searchResult.totalRecords {Number}
Service.prototype.search = function(searchRecord) {
assertConnection(this);
var soapObj = Serializer.serialize(searchRecord);
var search = denodeify(this.config.client.search);
return search(soapObj);
};
| Option name | Type | Description |
|---|---|---|
| searchId | String | search id from original search |
| pageIndex | Number | target page index to retrieve |
result description:
result.searchResult.status {String} Operation status. Contains more details on errors.result.searchResult.status.$attributes.isSuccess {String} Whether op was successful. String values of 'true' or 'false'[result.searchResult.status.statusDetail] {StatusDetail[]} Status details on error.result.searchResult.pageIndex {Number} one basedresult.searchResult.pageSize {Number}result.searchResult.recordList.record {Record[]} The actual records. Their types are dependent on the search typeresult.searchResult.searchId {String}result.searchResult.totalPages {Number}result.searchResult.totalRecords {Number}
Service.prototype.searchMoreWithId = function(searchId, pageIndex) {
assertConnection(this);
var searchMoreWithId = denodeify(this.config.client.searchMoreWithId);
return searchMoreWithId({
searchId: searchId,
pageIndex: pageIndex
});
};
| Option name | Type | Description |
|---|---|---|
| preferences | NetSuite.Search.SearchPreferences |
Adds or updates necessary SOAP headers to set search preferences.
Note these preferences persist across searches until updated or cleared.
Service.prototype.setSearchPreferences = function(preferences) {
this.config.removeSoapHeader('searchPreferences');
this.config.addSoapHeader(preferences);
};
Clears search preferences until setSearchPreferences() is called again.
Service.prototype.clearSearchPreferences = function() {
this.config.removeSoapHeader('searchPreferences');
};