erictgrubaugh
11/19/2020, 4:57 PMNicolas Bean
11/19/2020, 4:58 PMSandii
11/19/2020, 4:58 PM[0].values["propname"].value
or .text
erictgrubaugh
11/19/2020, 4:58 PMdata[0] // <= It's an Array with one Object element
data[0].recordType // <= "job"
data[0].values // <= the nested Object with the Columns
data[0].values["customer.internalid"] // <= must use bracket syntax because NetSuite put that stupid . in the property name
data[0].values["customer.internalid"][0] // <= Select Columns manifest as Arrays
data[0].values["customer.internalid"][0].value // <= "850"
Sandii
11/19/2020, 4:59 PMtoJSON()
on the result I guess?Nicolas Bean
11/19/2020, 5:00 PMjobres[0].id
but jobres[0].values.custentitycert_billing_uom.text
does not - I have a function that returns a search result (I did not put toJSON())erictgrubaugh
11/19/2020, 5:01 PMcustentitycert_billing_uom
is an Arrayerictgrubaugh
11/19/2020, 5:01 PMNicolas Bean
11/19/2020, 5:01 PMjobres[0].values.custentitycert_billing_uom[0].text
Nicolas Bean
11/19/2020, 5:01 PMSandii
11/19/2020, 5:01 PMSandii
11/19/2020, 5:02 PMtoJSON()
this then the object might just be printing like this, and you need to use the actual search call getValue()
erictgrubaugh
11/19/2020, 5:02 PMNicolas Bean
11/19/2020, 5:03 PMbattk
11/19/2020, 5:03 PMerictgrubaugh
11/19/2020, 5:04 PMNicolas Bean
11/19/2020, 5:04 PMSandii
11/19/2020, 5:04 PM.each()
call?Nicolas Bean
11/19/2020, 5:04 PMfunction getProjectInformation(project) {
var jobSearchObj = search.create({
type: "job",
filters: [
["entityid", "contains", project]
],
columns: [
search.createColumn({
name: "internalid",
join: "customer",
label: "Customer Internal ID"
}),
search.createColumn({
name: "custentitycert_billing_uom",
label: "Invoice Billing Unit of Measure"
})
]
});
var projectdata = jobSearchObj.run().getRange(0,999);
return projectdata;
}
}
Nicolas Bean
11/19/2020, 5:04 PMerictgrubaugh
11/19/2020, 5:05 PMerictgrubaugh
11/19/2020, 5:06 PMvar results = getProjectInformation(data);
results[0].getValue({name: "custentitycert_billing_uom"});
results[0].getValue({name: "internalid", join: "customer"});
Nicolas Bean
11/19/2020, 5:06 PMvar billingtype = jobres[0].getValue({fieldId:'custentitycert_billing_uom'});
log.debug('billingtype',billingtype);
I am just trying to put the field value into a variable and print.. no error message it just doesn't print anythingerictgrubaugh
11/19/2020, 5:06 PMname
, not fieldId
Nicolas Bean
11/19/2020, 5:06 PMNicolas Bean
11/19/2020, 5:06 PMSandii
11/19/2020, 5:07 PM.each()
or runPaged()
if you expect a lot of resutlsNicolas Bean
11/19/2020, 5:07 PMNicolas Bean
11/19/2020, 5:08 PMSandii
11/19/2020, 5:08 PMbattk
11/19/2020, 5:08 PM[
{
recordType: "job",
id: "861",
values: {
"customer.internalid": [
{
value: "850",
text: "850"
}
],
custentitycert_billing_uom: [
{
value: "3",
text: "INVOICE GJ"
}
]
}
}
]
since netsuite will stringify objects in logsbattk
11/19/2020, 5:08 PMbattk
11/19/2020, 5:09 PMNicolas Bean
11/19/2020, 5:09 PMNicolas Bean
11/19/2020, 5:09 PMNicolas Bean
11/19/2020, 5:17 PMbattk
11/19/2020, 5:20 PMNicolas Bean
11/19/2020, 5:20 PM