Vedachalam Mahadevan
02/25/2025, 7:26 AMCeligo AI
02/25/2025, 7:26 AMAI generated answer (using internal Slack threads):The error
SSS_INVALID_TYPE_ARG with details You have entered an invalid type argument: MISCBINARY is occurring because you are trying to create a file with a type that is not supported by NetSuite's file.Type enumeration.
In your case, you are trying to create a .pem file. However, .pem is not a supported file type in NetSuite. You can check the list of supported file types in NetSuite [here](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_4228999954.html).
As a workaround, you can try the following:
1. Save the file as a plaintext file, but save it with the extension .pem for the filename.
2. Save the file as a plaintext file and save it with the extension .txt. Then load it again and change the name to have the extension .pem, and save it.
Here is a sample code snippet:
javascript
function saveFile(fileField) {
var fileObj = file.create({
name: fileField.name,
fileType: file.Type.PLAINTEXT, // change this line
contents: fileField.getContents(),
folder: 4165
});
var fileId = fileObj.save();
return fileId;
}
In the above code, fileType is set to file.Type.PLAINTEXT instead of fileField.fileType.
For .msg or .ods extensions, you might face a similar issue as these are not standard file types in NetSuite. The MISCBINARY type you see in the file cabinet is not a type you can set yourself when creating a file, it's a type NetSuite uses internally for certain types of files.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
02/25/2025, 7:27 AMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.825747848
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.821362197
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.820340872
Celigo AI
02/25/2025, 7:27 AM