Determine the customer associated with a job (project) via NetSuite SuiteTalk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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