Hello,
I would like to make a validation script when the user import a Journal Entry.
First idea is creating UE BeforeSubmit and if validation fails, I will throw an error. But, I would like to reference exactly line where are invalid data.
It will be ideal if the user got results can see what is error.
Is it sound that "client script" and validate line can somehow used?
g
Geo
07/30/2025, 1:34 PM
Depending on what you are trying to validate and what you want the user to see you could do error.create and the throw that custom_error or custom_error.message. If you are looping the lines in a UE before submit to run your validation I would sure think you could reference the line and whatever other data and reference that directly in the error message. https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_4243803203.html
a
Anthony OConnor
07/30/2025, 1:36 PM
you said they are importing a JE? like using a CSV import process?
that isn't going to trigger any client scripts so a UE will be the only way... similarly you can't report anything to the user other than the success/failure they will see on the csv import status screen (and emailed to the logged in user)
e
Edgar Valdes
07/30/2025, 3:15 PM
I did that recently. When a user creates a JE using a CSV Import the native functionality stops the processing at the first column/line when there is an error. If the error is in column 1 line 1, and the file has 1,000 lines the users grows frustrated with every attempt. So I created a UE script that iterates the whole file, validate the lines and throws an error at the save event (not at the line commit event). It then creates a file with all the columns/lines that don't pass the validation and email the user.
👍 1
Edgar Valdes
07/30/2025, 3:16 PM
Not perfect, but the users are more happy that way.
z
Zoran R-DATAGRAM
07/31/2025, 7:47 AM
Thank you all,
to summarize:
• throw error will be return error in result.csv
• there is no way to put error message in particular csv line (simulate validate_line from client script)
I have already realized validation all lines in before submit and user will get all-in-one, but I see that error message is filled in the cell first row/column... that's why asked if there is a trick/hack to put error in each line with invalidate data
Once again, thank you for replies