Overview
Managing Item Fulfillments in NetSuite can be challenging, especially when external stakeholders, such as shipping companies, need access to specific data. A custom Suitelet can streamline this process by providing a user-friendly interface to retrieve and filter Item Fulfillments based on Sales Orders and locations. This Suitelet eliminates the need for manual intervention, making it efficient for both your team and third-party logistics providers.
Functionality
The Suitelet serves as a web-based tool that does not require a NetSuite login, making it accessible to external users. Here’s how it works:
- Sales Order Selection: The user enters the Sales Order document number in a provided field. The Suitelet retrieves all associated Item Fulfillments.
- Location Filtering: The results include a dropdown menu displaying all unique locations from the retrieved Item Fulfillments. The user can select a location to filter the results dynamically.
- Real-Time Updates: The filtered list instantly updates, showing only the relevant Item Fulfillments for the selected location.
This solution is particularly beneficial for sharing fulfillment data with shipping companies, allowing them to independently access and filter records without requiring NetSuite credentials.
Sample Code
Below is an example Suitelet script for implementing this functionality:
/**
* @NApiVersion 2.x
* @NScriptType Suitelet
*/
define(['N/ui/serverWidget', 'N/search'], function (serverWidget, search) {
function onRequest(context) {
if (context.request.method === 'GET') {
var form = serverWidget.createForm({ title: 'Sales Order Viewer' });
var salesOrderField = form.addField({
id: 'custpage_salesorder',
type: serverWidget.FieldType.SELECT,
label: 'Sales Order'
});
salesOrderField.addSelectOption({ value: '', text: 'Select a Sales Order' });
search.create({
type: "salesorder",
filters: [["mainline", "is", "T"]],
columns: [
search.createColumn({ name: "tranid" }),
search.createColumn({ name: "internalid" })
]
}).run().each(function (result) {
salesOrderField.addSelectOption({
value: result.getValue({ name: "internalid" }),
text: result.getValue({ name: "tranid" })
});
return true;
});
form.addSubmitButton({ label: 'View Item Fulfillments' });
context.response.writePage(form);
}
}
return { onRequest: onRequest };
});
Conclusion
This Suitelet enhances efficiency and collaboration by simplifying the management and sharing of Item Fulfillments. It ensures external stakeholders, like shipping companies, have secure, role-free access to necessary data. Let us know if you’d like assistance deploying or customizing this solution!