There’s an “openingBalance” field in the Account t...
# ask-stanley-ai
j
There’s an “openingBalance” field in the Account type in the Schema Browser. how can I fetch that value via API?
c
AI generated answer (using internal Slack threads):
To fetch the "openingBalance" field in the Account type via API, you can use SuiteTalk API or SuiteQL. For SuiteTalk API, you can use the
get
operation to retrieve a single record or the
search
operation to retrieve multiple records. The
get
operation requires the internalId of the account you want to fetch. Here is a sample request:
Copy code
xml
<get xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
  <baseRef xmlns="urn:core_2017_1.platform.webservices.netsuite.com" type="account" internalId="1"/>
</get>
For SuiteQL, you can use a SQL-like query to fetch the data. Here is a sample SuiteQL query:
Copy code
sql
SELECT AcctType, AcctNumber, FullName, Description, Balance
FROM Account
ORDER BY AcctType ASC, FullName ASC
Please note that the "openingBalance" field might not be directly available via the REST API. You might need to calculate it by summing the amount of transaction accounting lines that are posting, grouped by the account's id. ****** 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.820825696
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.816295683
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.814972401
Please provide your feedback on this answer.