Use Script Function to Avoid Blank Cells When Generating CSV File via SuiteScript
Published on
February 29, 2024 at 7:27:07 AM PST February 29, 2024 at 7:27:07 AM PSTth, February 29, 2024 at 7:27:07 AM PST
Scenario
Upon creating a CSV file based off a saved search via Script, the user encounters a blank cell and succeeding field values are then populated on the next line in which is caused by either a line break, Pipe, or illegal characters on either one of the fields. (i.e. memo/comment field)
Solution
The data from the field must first undergo this logic so that it can be formatted to fit through a single column each time a data is being passed and assigned to a column. This will avoid a next line placement for each line within the item description.
To do this, itfunctions that will eliminate said unwanted HTML character codes.