Are the values from a csv import available to chec...
# suitescript
b
Are the values from a csv import available to check in the before load of a 1.0 user event script? Other execution contexts populate the request parameter but request is null for csv import. I'm looking for a way to run similar validations as I do for UI contexts.
r
You can do
Copy code
nlapiGetContext().getExecutionContext()
If you want to get the field values of the record being imported, you can use
nlapiGetNewRecord()
to get the record object.
b
Yes, that gives me the execution context so I can distinguish csv from ui interactions. I'm looking for the proposed record values.
r
See my edit
Now that I think about it, I think that will be blank/null for new records since you mentioned before load. If you want to get the values before it is saved to the db, you can use that in the before submit event
b
Just did a quick check and that seems to be the case (call returns null). I'm not sure how cancelling a before submit would work during a csv import but I might have to look into that.
r
You will need to throw an error if you dont want the record to be saved