Skip to content

Instantly share code, notes, and snippets.

@iloveitaly
Last active April 18, 2017 16:21
Show Gist options
  • Save iloveitaly/0db19602bae074ff9431a653c1deaaaf to your computer and use it in GitHub Desktop.
Save iloveitaly/0db19602bae074ff9431a653c1deaaaf to your computer and use it in GitHub Desktop.
Determine the customer associated with a job (project) via NetSuite SuiteTalk
# Author <mike@suitesync.io>
# More info: http://mikebian.co/notes-on-working-with-jobs-projects-using-the-suitetalk-netsuite-api/
ns_job_internal_id = 123
mapping_search = NetSuite::Records::Job.search(
criteria: {
basic: [
{
field: 'internalId',
operator: 'anyOf',
value: [ ns_job_internal_id ]
}
# NOTE there's no mainLine option for job search
]
},
columns: {
'listRel:basic' => {
'platformCommon:internalId/' => {},
'platformCommon:customer/' => {},
}
},
preferences: {
page_size: 1_000,
body_fields_only: true
}
)
mapping_search.results.first.customer.internal_id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment