I have a customer complaining that their users seeing an error when they place an order from SuiteCommerce. Some users have sales order created successfully while some resulting in error. If a user gets an error, if that user registers a new account with different email address, it works fine. It's very random below is a flow
User places an order form web > NetSuite creates a Temp Sales Order with ID > Creates a Customer Deposit > Error occurs and Temp Sales Order gets deleted.
Below is an error identified but not sure what's causing it:
Exception Message: com.netledger.common.exceptions.NLException: Exception while creating Customer Deposit to accommodate selected Payment Method Caused by: com.netledger.core.record.query.NLRecordValidation$InvalidReferenceKeyUserError: Invalid location reference key 3 for subsidiary <NULL>.
Below are some useful information
- Account has only one subsidiary active. There's an inactive subsidiary but not deleted.
- customer record which places an order has correct subsidiary.
- Location (with id = 3) has correct subsidiary reference.
- User event script deployed on customer deposit doesn't show any error logs. However, one script does execute in webstore context but I don't see any issue.
- there's a Workflow that I added to set location on customer deposit thinking it's coming in empty but that did not make any difference.
Any help or insight is much appreciated!
Thanks,
Vishal