get account id in suitescript 1.0
# ask-stanley-ai
k
get account id in suitescript 1.0
c
AI generated answer (using internal Slack threads):
In SuiteScript 1.0, you can get the account ID by using the
nlapiGetContext().getCompany()
method. This method returns the internal ID of the account. Here is a sample code snippet:
Copy code
javascript
var context = nlapiGetContext();
var accountId = context.getCompany();
In this code,
nlapiGetContext()
returns the execution context of the script, and
getCompany()
returns the internal ID of the account. Please note that this method returns the internal ID, not the account number. If you are trying to create a JE using an account number, you might need to look up the internal ID of the account using the account number first. ****** 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.818054199
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.817138672
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.812866271
Please provide your feedback on this answer.