getting a 400 error when using the externalId in q...
# ask-stanley-ai
l
getting a 400 error when using the externalId in queries on sales orders: on url /services/rest/record/v1/salesOrder/?q=externalId%20is%20%22SHP Error 400, detail [{'detail': "Unknown field name 'externalId' in the search query. The field does not exist on this record type.", 'o:errorQueryParam': 'q', 'o:errorCode': 'NONEXISTENT_FIELD'}
c
AI generated answer (using internal Slack threads):
Based on the conversations, it seems that you cannot directly use the
externalId
as a key in SuiteScript or set a field by
externalId
. Instead, you would need to perform a search or query to filter by
externalId
, and then retrieve the internal id of the matching result. This applies to list items such as products or currencies. For creating a Journal Entry, it was suggested that it might be possible to set the
entity
on a line via
externalId
, but this was not confirmed. It was recommended to refer to the NetSuite documentation for more details. Regarding the error you're encountering when creating a sales order using the REST API, it was suggested to try creating the sales order in the UI using the same values as your request. This is because web services generally follow the same rules as the UI. If the shipping method with internal id 1249 is active and available for the subsidiary in the UI, it should also be valid in the API request. ****** 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.850580037
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.842360497
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.841139197
Please provide your feedback on this answer.