I am not able to access createdby field on sales o...
# ask-stanley-ai
t
I am not able to access createdby field on sales order record load, though it is available on search, what field can I use for gettting created by on sales order record.load
c
AI generated answer (using internal Slack threads):
In NetSuite, the
createdby
field is not directly accessible when you load a sales order record. However, you can access this field through a search operation. If you need to access the
createdby
field on a sales order record load, you might need to perform a search operation to get this field. Here is a sample code snippet in SuiteScript:
Copy code
javascript
var salesOrderSearch = search.create({
   type: search.Type.SALES_ORDER,
   filters: ['internalid', search.Operator.ANYOF, [salesOrderId]],
   columns: ['createdby']
});

salesOrderSearch.run().each(function(result) {
   var createdBy = result.getValue(result.columns[0]);
   // Do something with createdBy
   return true;
});
In this code, replace
salesOrderId
with the internal ID of the sales order record you are loading. The
createdby
field will be available in the search results. ****** 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.828389227
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.821304262
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.819655359
Please provide your feedback on this answer.