How does one go about editing ALL the text of a fi...
# suitescript
j
How does one go about editing ALL the text of a file? I have an XML file that needs to have the text completely replaced via SuiteScript.
b
create a new file
overwrite the old file
j
no…that won’t work. The ID is stored on another record.
b
try it anyways
j
? I don’t get how that would work. Then the ID would be wrong, no?
I need to have it be the same file ID.
b
the experiment does not take long
do it on a file you dont like if you like your test file
j
I don’t even know how to “overwrite”, what do you mean by that.
b
create a new file
use the same path as the old one
j
Just make two files with teh same name?
b
same name, same path
j
This does work, It will overwrite the file and retain the ID. But it needs to be the same path and filename
b
you have ruined the minor surprise
😄 2
j
well that’s…..fucky.
you could have just said “if you create a file with the same name and the same path, it will retain the same ID”
I feel it really should NOT be that way - it should throw an error
this seems like an extremely dangerous thing
j
yes heh
b
its strange enough that you would want to try it yourself before trusting someone else