You have entered an Invalid Field Value 1358 for t...
# ask-stanley-ai
a
You have entered an Invalid Field Value 1358 for the following field: account But that ID is valid, it works perfectly fine when I'm filling out the expense sublist on a new Vendor Bill in the NetSuite UI. Why doesn't it work in Suitescript? By the time that part of the code executes, where I'm setting expense sublist : account field, then the code has already set the new Bill record's Vendor (entity) field. I'm using the account ID, not the account number, in my setCurrentSublistValue() call, and the Vendor is already set, and the Subsidiary is already set when it gets to this call.
c
AI generated answer (using internal Slack threads):
Based on the conversations, it seems like the issue you're facing is related to the account type and the subsidiary. In NetSuite, when setting the account field on the expense tab of a bill, you need to ensure that the account is valid for the subsidiary and it's an expense account. If you're using a non-posting account, it might not work. Even though you can select a non-posting account in the UI, it might not allow you to save it. In the context of an Advanced Intercompany Journal Entry (AIJE), you need to ensure that the account is a valid option for the subsidiary. If the account is not in the list of options, it means a field that sources the account has filtered out your account. For the issue with setting the entity in the AIJE, make sure you're using the Inter-Company Customer/Vendor, not the normal Customer/Vendor. Here's a sample of how you can set the account field:
Copy code
javascript
aije.selectNewLine({ sublistId: 'line' });
aije.setCurrentSublistValue({
    sublistId: 'line',
    fieldId: 'subsidiary',
    value: lineData.subsidiary
});
aije.setCurrentSublistValue({
    sublistId: 'line',
    fieldId: 'account',
    value: lineData.account
});
****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.884033203
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.869628787
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.865661681
Please provide your feedback on this answer.
Thank you for your feedback