Hi again! I'm still fighting with an `ERR_BLOCKED_...
# suitescript
k
Hi again! I'm still fighting with an
ERR_BLOCKED_BY_XSS_AUDITOR
error. Yes, I know it's Chrome trying to block potentially harmful code. No I'm not willing to tell my users to simply not use chrome. Thus I need to fix my script. The error is in a SuiteGL plug-in and only occurs when trying to add a new GL line to the GL impact of an invoice that uses the transaction level Discount Item field. Could anyone please help me troubleshoot this?
j
I don't know if this will be of much help, but I have received that error before and I am fairly sure it was not caused by any of our scripting. I have only seen it in connection to problems with serial numbers, e.g. a closed sales order line item (quantity=0) with serial number, or a credit memo on an item (quantity=1) without serial number. In these situations I discovered the underlying issue by manipulating the transaction through suitescript instead of through the UI, i.e. in console or debugger I would get an error thrown when I did
nlapiSubmitRecord(...)
k
How did you discover the underlying issue through suitescript?
j
The users saw the XSS auditor false positive when pressing save on the transaction, and in at least one case it happened even without making any changes to any fields. For this case, I loaded the record and then immediately saved it:
var rec = nlapiLoadRecord(...);    nlapiSubmitRecord(rec);
. The call to
nlapiSubmitRecord
threw an error. I don't remember the error code but the error's detail message was
The following serial number is already in inventory...
In another case the users were getting the XSS problem when creating a record in a specific way, so I did my best to simulate the record they were making with suitescript
var rec = nlapiCreateRecord(...);  rec.setFieldValue(...) etc;  nlapiSubmitRecord(rec);
k
Ok, I'll try that, thank you!
j
nlapiSubmitRecord
threw an error in that case too. "The number of serial numbers is not equal to the line item quantity."
np hope it helps 🙂
k
Yup, that got me a valid GL plug-in error! Thank you!
j
🎉
NP, don't know what Netsuite does client side to trigger the issue, but I strongly suspect it's on them netsuite