Can I add columns to a saved search loaded in suit...
# ask-stanley-ai
j
Can I add columns to a saved search loaded in suitescript?
c
AI generated answer (using internal Slack threads):
****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ****** Yes, you can add columns to a saved search loaded in SuiteScript. However, it's important to note that this is done programmatically and not through the NetSuite UI. Here's a basic example of how you might add a column to a saved search in SuiteScript:
Copy code
javascript
var search = require('N/search');
var mySearch = search.load({
    id: 'customsearch_my_search'
});

// Add a new column
mySearch.columns.push(search.createColumn({
    name: 'custrecord_my_custom_field'
}));

// Run the search
var resultSet = mySearch.run();
In this example,
customsearch_my_search
is the ID of the saved search you're loading, and
custrecord_my_custom_field
is the ID of the custom field you're adding as a column. Remember, this will only affect the search results when you run the search in your script. It will not permanently modify the saved search in the NetSuite UI.
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.861376286
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.851989448
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.850359082
Please provide your feedback on this answer.