how do I create a non nventory item through a suit...
# ask-stanley-ai
i
how do I create a non nventory item through a suite script?
c
AI generated answer (using internal Slack threads):
To create a non-inventory item through SuiteScript, you can use the
record.create
method. Here is a sample code snippet:
Copy code
javascript
var nonInventoryItem = record.create({
    type: record.Type.NON_INVENTORY_ITEM,
    isDynamic: true,
});

nonInventoryItem.setValue({
    fieldId: 'itemid',
    value: 'Your Item Name'
});

nonInventoryItem.setValue({
    fieldId: 'displayname',
    value: 'Your Display Name'
});

nonInventoryItem.setValue({
    fieldId: 'purchaseprice',
    value: 10
});

nonInventoryItem.setValue({
    fieldId: 'salesdescription',
    value: 'Your Sales Description'
});

var recordId = nonInventoryItem.save({
    enableSourcing: true,
    ignoreMandatoryFields: true
});
This script will create a new non-inventory item with the specified values. You can set other fields as needed. ****** 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.838861585
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.838209808
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.832598388
Please provide your feedback on this answer.