I am getting this error on a custom GL Plugin Set...
# ask-stanley-ai
t
I am getting this error on a custom GL Plugin Setting entity on GL line with account of type {account type} is not allowed for book-specific transactions. You specified an entity with an accounts receivable or accounts payable account type that is not allowed with a book-specific line.
c
AI generated answer (using internal Slack threads):
****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ****** The error message you're encountering is due to a validation failure in your Custom GL Lines Plugin. The error message indicates that you're trying to set an entity on a GL line with an account type that is not allowed for book-specific transactions. In NetSuite, certain account types are not allowed to be associated with certain entity types. For example, you cannot specify a vendor with an accounts payable account, or a customer with an accounts receivable account. In your case, it seems like you're trying to set an entity for an account of type 'AcctRec' (Accounts Receivable) which is not allowed for book-specific transactions. Here's a snippet from your code that might be causing the issue:
Copy code
javascript
firstNewLine.setEntityId(glEntityId);
firstNewLine.setAccountId(glAccountID);
You're setting the entity ID and account ID for a new line. If the account ID (
glAccountID
) is of type 'AcctRec', and the entity ID (
glEntityId
) is not compatible with this account type, you will encounter this error. To resolve this issue, you need to ensure that the account type specified in
setAccountId(accountId)
is appropriate for the entity type. If you're still encountering issues, you might want to check if there's a Custom GL Plugin running for the transaction type you're working with (e.g., Customer Refund). If there is, you might need to adjust the settings or disable it to prevent this error. Remember, the account type and entity type must be compatible according to NetSuite's rules. If they're not, you'll need to adjust your code accordingly.
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.915713
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.88925916
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.867703438
Please provide your feedback on this answer.
Thank you for your feedback