in this test scenario, dir 2077 was empty and the ...
# suitescript
c
in this test scenario, dir 2077 was empty and the file was in 2078. If I delete the file in 2078, and place the file in 2077, the code picks up the file in 2077 as expected. If the file is in both dirs, it prefers the sub-dir 2078.
c
Try a folder search not file and use a file.name/file.internalid join as a column.
c
I'll give this a try later - thanks.
a
I wasn't aware there WAS a file search? I thought you HAD to do folder searches?
c
@Anthony OConnor surprised it doesn't throw an error
This is why it's better to use search.Type.xxx instead of a string.
a
i mean there clearly is a file search cos it DIDNT throw the error, but it isn't documented so I wouldn't trust it
... err well actually apparently it is ... somewhat documented? https://www.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2023_1/script/record/file.html
c
Regardless, it certainly doesn't work the way you think it should
It will happily traverse sub-directories
a
can you change your folder structure... filesToProcesss ---Processed to ProcessName ---Pending ---Processed That way they aren't in each others subfolders
kinda hacky but might be the quickest way to be able to move on with your life 🙂
c
A folder search should work fine. You know the folder ID and the file name you can search on all of that. I have this exact code in my projects
c
I'll change it to that