You can check the execution context, nlapiGetConte...
# suitescript
r
You can check the execution context, nlapiGetContext().getExecutionContext(). If it is through the UI, it should return userinterface