RE: Suite script to import and run csv file

Hi Expert,In order to create a journal entry we need to populate a csv file with required fields and run in the UI.Can we write a suitte script to read the csv file and run that csv file to generate a journal entry .Could you please help out ?

AHarshini Rookie Asked on June 30, 2022 in SuiteScript.
Add Comment
4 Answers

hi Sonny,
in my case, for my work, I created a script with sutetalk to automatically import the file into the cabinet
in this way I have made the process completely automated

I hope it can be of help


string filename = “PeopleExpress.csv”;
byte[] fileContent = System.IO.File.ReadAllBytes(path);

public static void uploadfile(NSClient ns, string NetsuiteCartella, byte[] fileContent, string filename)
// UPLOAD file cabinet
FolderSearch fldSearch = new FolderSearch();
FolderSearchBasic fldSrearchBasic = new FolderSearchBasic();
SearchStringField searchFolder = null;
//Name of the folder that we want to search
string searchValue = NetsuiteCartella;
//Filtering by the folder name
searchFolder = new SearchStringField();
searchFolder.@operator = SearchStringFieldOperator.@is;
//Search operator
searchFolder.operatorSpecified = true;
searchFolder.searchValue = searchValue;
//searchValue is name of the folder “Demo” = searchFolder;
fldSearch.basic = fldSrearchBasic;
// Search by isActive field which is a boolean
SearchBooleanField isActive = new SearchBooleanField();
isActive.searchValue = true;
isActive.searchValueSpecified = true;
// Invoke search() web services operation
SearchResult response =;
//Now stroring the search result in an array
Record[] arrRecord = (Record[])response.recordList;
// Process response
if (response.status.isSuccess)
Console.WriteLine(“internalId : {0}”, “search is successful”);
Folder fldr = (Folder)arrRecord[0];
//Getting a specific folder from the search
string fldrId = fldr.internalId;
//Fetching the required folder’s internal ID
RecordRef refId = new RecordRef();
refId.internalId = fldrId;
//Storing the folder id
//File object created to get all the file information
File objFile = new File(); = filename; //setting the file name
objFile.folder = refId; //setting the folder information
objFile.content = fileContent; //settig the file content
WriteResponse writeResponse = Client.Service.add(objFile);
Console.WriteLine(“internalId : {0}”, “search not found”);




Rookie Answered on July 19, 2022.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.