How can i load a custom record using "external id" suitescript 2.0
a
Alan Fitch
02/07/2022, 2:18 PM
What was wrong with my answer earlier?
l
Livio
02/07/2022, 2:44 PM
i meant to reply to you but i couldnt find my previous message
im getting an error
Cannot read property "id" from undefined
j
jarens
02/07/2022, 3:03 PM
Your code looks valid. Are you sure that data.data[i].sku is a valid external id of the custom record you're working with? I'd log it out or try manually putting in the external id as a test.
l
Livio
02/07/2022, 4:06 PM
yes i figured what i did wrong
Livio
02/07/2022, 4:06 PM
thank you
a
Alan Fitch
02/07/2022, 4:06 PM
Do you mind sharing?
l
Livio
02/07/2022, 4:15 PM
i had to add this before the query line
var data = JSON.parse(getData.body);
a
Alan Fitch
02/07/2022, 4:16 PM
Ah ok. I like learning from other peoples mistakes.