MODULE_DOES_NOT_EXIST SuiteScript even after i have added ".js" - netsuite

I am having some issue for the SuiteScript while trying to create a new one. I followed other answers to add ".js" at the end of the script file name, but the error still showing:
enter image description here
enter image description here
enter image description here
Is there any other ways to solve the problem?
This is the error:
Fail to evaluate script: {"type":"error.SuiteScriptModuleLoaderError","name":"MODULE_DOES_NOT_EXIST","message":"Module does not exist: /SuiteScripts/TF_LIB_MassDeletionScript2.0.js","stack":[]}

Looks like the error is telling you that a module referenced in the script file you are trying to upload cannot be found. Don't forget that the system parses your script file when you try to upload it, so if there are syntax errors or other problems, the file cannot be uploaded. Make sure that the TF_LIB_MassDeletionScript2.0.js file is in the SuiteScripts folder before you try to upload your YY_Script.js file.

Ironically, you need to exclude the file extension in the TF_LIB_MassDeletionScript2.0 module relative reference. (just the reference, not the module file name)
Also, a "." in a relative reference tells the compiler to go back a level, so you probably need to rename your module file to something like TF_LIB_MassDeletionScript2_0 and update the reference

Related

Editing the .env file using node.js

I have a check.env file, in which I have some variables like
SharedAccessKey=
I want to put a value in the check.env file from my node.js code. Articles on internet are there for updating at the running time of node.js, but my requirement is to change in the file and keep the file with changes made.
How can I accomplish that.
I got this link : How to change variables in the .env file dynamically in Laravel?
but it is in some other language, how can I do in node.js.
I was unable to find out the best solution so went with another solution of mine that I took.
I am using two files now both .env extensions and I am copying main .env file to another empty .env file (like check1.env to check2.env).
Any modifications I am making is in the second file (check2.env).
And I am using string replacement in the .env file, using fs.readLine() and getting the string and the data.replace(), this worked for me.
The reason to use two .env files is that even if I change in the second file, again by copying from the first file I will get same string search and will replace with a different value.
-- Please suggest if there is an any better approach. Thanks

touching a path name with varriable or other methode

I have a question about touching a path in a shell script. I'm making a script that clears some directories and add some files, now I'm trying to do this with touch /name/of/path instead of a find. I have some troubles with one of the paths this is becaus the last bit of the name changes in every file (the files are about working orders) now I tried some stuff like a variable or just the path with a * but it gives me an error
can anyone tell me if i need to change my variable for example.
the variable im currently using:
test='path/to/touch/annoy\ ing\ space*/'
and in my code I would like to execute this like
touch $test/test.txt
the error I get when running this is
touch: invalid option --'\'
I guess i get this option because there are \ in the varriabe but that is because there are spaces in the directory name I'm trying to enter.
I also tried something like this
touch path/to/touch/annoy\ ing\ space*/test.txt
but I also get an error when I try it like this, I read this is because I use a wildcard in touch and that isn't allowed. Can anyone confirm this?
If someone could give me an example or tip how to do this it would realy help me out. thanks in advance

How to find a .zip file in the current directory using Groovy?

I have a .zip file in the current directory, I want to get its file name using Groovy. e.g. if the file is myfile.zip, I want to get the "myfile" part. Can anyone give me a code snip? Thanks.
Something like this should work:
filename=new File("directory").listFiles().find{it.name.endsWith(".zip")}
If you don't want the .zip on the end, subtract it:
filename=new File("directory").listFiles().find{it.name.endsWith(".zip")}.name - ".zip"
(By the way, the first one ends up with a file object--you can do whatever you want with it. The second ends up with the string that is the name without the .zip)

External reference to a file that gets replaced

I've got a file on my local drive that is being replaced with a newer version of it every 10 minutes.
I'd like to make a function reference to this file in another workbook, but the link is being broken every time the automatically generated file is being replaced (which is perfectly logical).
Is there a way to retain a link to the external file?
Perhaps keep an identical name for the file that keeps being replaced.
i.e instead of "Timesheet 10/08/2016 10:07" give it a custom name which remains immutable; that way the link will remain unbroken as it will be referencing the same file
Unfortutnately the file already has a static name (HPI.xlsx) and the link is getting broken anyway.

How Can I Specify a Directory without Using the Full Directory Name? - Python 3.4

I don't want to specify the full directory of a folder or object within my program. I do not want to do this because if a user decides to change the installation folder, it will not function properly. I've seen in HTML you can do something like: ./folder/directory/name and it would work perfectly fine. Is there a way to do something like that within Python?
From https://docs.python.org/3/reference/datamodel.html
__file__ is the pathname of the file from which the module was loaded
You may find it helpful to apply os.path.abspath() to '.' or __file__.

Resources