when doing a REST api call to update lines on an i...
# ask-stanley-ai
g
when doing a REST api call to update lines on an itemReceipt how would one change 'restock' to NO instead of YES. tried all of the obvious "restock": false "receiveItem": false etc PATCH
<https://XXXXXX.suitetalk.api.netsuite.com/services/rest/record/v1/itemReceipt/17097780/?replace=item>
Payload
Copy code
{
  "item": {
    "items": [
      {
        "line": 1,
        "location": {
          "id": 3
        },
        "itemReceive": false
      }
    ]
  }
}
itemReceive seems to remove the whole line, i just need to know how to set Restock to false.
c
AI generated answer (using internal Slack threads):
Based on the conversations, it seems that the issue lies in the way the REST API call is being made. The error message indicates that there is an invalid sublist or line item operation, which suggests that the operation is trying to access a non-existent line or trying to add or remove lines from a static sublist. In the context of NetSuite, the 'restock' field is not directly accessible via the REST API for itemReceipt. The 'restock' field is typically controlled by the 'itemReceive' field. If 'itemReceive' is set to false, it implies that the item is not received and hence not restocked. However, it's important to note that setting 'itemReceive' to false might remove the entire line, as per the conversation. Therefore, to change 'restock' to NO, you might need to set 'itemReceive' to false and ensure not to modify other line fields in the same line. Here is a sample payload:
Copy code
{
  "item": {
    "items": [
      {
        "line": 1,
        "location": {
          "id": 3
        },
        "itemReceive": false
      }
    ]
  }
}
Please note that this is based on the information available in the conversations and might not work in all scenarios. Always test your API calls thoroughly before implementing them in a production environment. ****** 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.868979096
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.855231225
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.844432414
Please provide your feedback on this answer.