i am trying to import CSV into netsuite. when i do...
# suitescript
v
i am trying to import CSV into netsuite. when i do this manually for example for the record type employee, how could i take that record type thru scripting?
s
the best suggestion would be to include record type as a column in the CSV, if possible
v
thats not possible, i have this, from this i need to take the type
a
you save the import through the UI like the list that your screenshot shows. then you reference the saved import in your script
s
sorry, I misinterpreted the question as to how you could modify the CSV file so that the script would know the record type, not as scripting a saved CSV import
a
¯\_(ツ)_/¯
v
what do you mean by reference? i tried get method, but it shows error
a
you're using the
N/task
yes? you just need to get the id of your saved CSV import and set it on the task object
v
yes i did that. from that how can i get the record type?
a
... its stored IN the saved CSV import that you are referencing?!
v
like file.load or record.load,?
a
do you want it for something OTHER than doing the import?!
v
i need the type like Employee or Time Sheet
yes for the .name property.
a
for the .name property of WHAT?
what are you trying to do with it?!
v
The client wants it like the record type + the name of the file as the JOB NAME;
The name property of the task
a
wow ok... hmm if you're able to select the import then don't you already know what the record type is? because it has to map to the correct import? so if you're importing time sheets - the import id for your time sheets import is for example 51, so if you know to chose 51 as the import type then you know it is time sheet already... otherwise how do you select the correct import mapping?!
can't you just leave it empty? isn't the default behavior to show it as <record type> - <filename> - <user>?
v
ah ok, that i really dont know that the number for each record type. Thank you so much.
i didnt try as empty, will try that then.
Thank you
a
lol 😄 ok
🙏 1