derekmhein
02/21/2025, 7:30 PMCeligo AI
02/21/2025, 7:31 PMAI generated answer (using internal Slack threads):To create a Suitelet that retrieves a list of Sales Orders with custom checkboxes (let's call them checkbox A and checkbox B), you would need to use SuiteScript to create a custom form with a sublist. Here's a general idea of how you could do it: 1. Create a Suitelet script that generates a form with a sublist. The sublist will contain the Sales Orders and the custom checkboxes.
javascript
var form = serverWidget.createForm({
title: 'Sales Order List'
});
var sublist = form.addSublist({
id: 'salesorderlist',
type: serverWidget.SublistType.LIST,
label: 'Sales Orders'
});
sublist.addField({
id: 'checkboxa',
type: serverWidget.FieldType.CHECKBOX,
label: 'Checkbox A'
});
sublist.addField({
id: 'checkboxb',
type: serverWidget.FieldType.CHECKBOX,
label: 'Checkbox B'
});
2. Use a search to retrieve the Sales Orders and populate the sublist.
javascript
var salesOrderSearch = search.create({
type: search.Type.SALES_ORDER,
// Add your filters and columns here
});
salesOrderSearch.run().each(function(result) {
sublist.setSublistValue({
id: 'checkboxa',
line: i,
value: result.getValue(result.columns[0]) // Replace with the actual column for checkbox A
});
sublist.setSublistValue({
id: 'checkboxb',
line: i,
value: result.getValue(result.columns[1]) // Replace with the actual column for checkbox B
});
i++;
return true;
});
3. Add a button to the form that will process the selected Sales Orders when clicked.
javascript
form.addButton({
id: 'processbutton',
label: 'Process Selected Orders',
functionName: 'processOrders'
});
4. In the client script, define the processOrders
function that will process the selected Sales Orders.
javascript
function processOrders() {
var sublist = document.getElementById('salesorderlist');
for (var i = 0; i < sublist.rows.length; i++) {
var checkboxA = sublist.rows[i].cells[0].firstChild.checked;
var checkboxB = sublist.rows[i].cells[1].firstChild.checked;
if (checkboxA && checkboxB) {
// Process the Sales Order
}
}
}
Please note that this is a simplified example and you would need to adjust it according to your specific requirements.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
02/21/2025, 7:31 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.817816615
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.811454892
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.811111629
Celigo AI
02/21/2025, 7:31 PM