Tax Calculation Plugin Error

When adding items to a transaction via a User Event Script or using Add Multiple in the UI, the HSN Code is not automatically sourced. This is a known limitation and considered an enhancement request.

Attempting to manually set the HSN Code within a User Event Script and then saving the record will result in the following error:

“Tax Calculation Plugin error: No applicable tax rule was found for this transaction.”

Solution: Suitelet-Based HSN Code Assignment

To resolve this, implement the following approach:

  1. Use a custom flag field on the record to control the flow.
  2. In the afterSubmit event of the User Event Script, invoke a Suitelet to set the HSN Code. Unlike User Event Scripts, Suitelets can successfully update the HSN Code without triggering the tax plugin error.
  3. The flag helps prevent infinite loops:
  • The Suitelet sets the flag to true after updating the HSN Code.
  • In the beforeLoad event, reset the flag to false whenever the record is edited manually.

This ensures the HSN Code is set correctly while maintaining system stability and avoiding recursive execution.

Leave a comment

Your email address will not be published. Required fields are marked *