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.
c
AI generated answer (using internal Slack threads):
Based on the conversations, it seems like the issue you're encountering is related to the context in which the account is being set in SuiteScript. In the first thread, the issue was that the account being set was a non-posting account. Non-posting accounts can be selected in the UI, but they cannot be used in scripts. In the second thread, the issue was that a field that sources the account was not set, which filtered out the account. The solution was to use
Field.getSelectOptions
to check the available options for the account field. In the third thread, the issue was that the account number was being used instead of the internal ID. In NetSuite, when setting the account field in SuiteScript, you should use the internal ID, not the account number. So, in your case, you should ensure that: 1. The account you're trying to set is not a non-posting account. 2. All fields that source the account field are set correctly. 3. You're using the internal ID of the account, not the account number. Remember, the context matters. The account that works in one context (like the UI) might not work in another context (like SuiteScript). ****** 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.88293457
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.865600467
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.86505127
Please provide your feedback on this answer.
d
Check the way you set field values in UI and suitescript follows along. if the sequence is incorrect these kind of issues occur. @Aaron McCausland
a
@Dhiraj Gore thanks for the reply. I found that I was setting the fields in the correct order. Using a different Account is what solved the problem, and that the Account I was trying to set on the Account field of the Expenses sublist that was causing the error, gets filtered out/made invalid for CSV Imports and SuiteScript, but not for UI somehow. The Account that didn't work is a Statistical account type, and the one that worked is of type "Other Current Asset". We want to use a non-posting type of account though, as these Vendor Bills are meant to be placeholders that get replaced once a Purchase Order is later created and received for it, so although this one change (of which Account is used for the placeholder expense line), made the whole thing work, it may not suit our needs.