How to display a scripted saved search on a subtab...
# ask-stanley-ai
a
How to display a scripted saved search on a subtab/sublist? Does this have to be a Suitelet or can this be achieved via a UE script
c
AI generated answer (using internal Slack threads):
To display a scripted saved search on a subtab/sublist, you can use a Suitelet. A Suitelet allows you to create a custom page where you can display the results of a saved search in a sublist. This can be achieved by creating a sublist on the Suitelet and populating it with the results of the saved search. Here is a sample code snippet that was shared in the conversations:
Copy code
javascript
const form = serverWidget.createForm({
  title: "Related Opportunities for Parent and Sub Customers",
});

const reloppinfo = form.addFieldGroup({
  id: "reloppinfo",
  label: "Filters",
});
const customer = form.addField({
  id: "customerfield",
  type: serverWidget.FieldType.SELECT,
  label: "Supervisor",
  source: record.Type.CUSTOMER,
  container: "reloppinfo",
});
customer.defaultValue = data.customerfield;

const sublist = form.addSublist({
  id: "oppsublist",
  type: serverWidget.SublistType.LIST,
  label: "Related Opportunities",
});
sublist.addField({
  id: "internalid",
  type: serverWidget.FieldType.TEXT,
  label: "Internal ID",
});
sublist.addField({
  id: "documentnumber",
  type: serverWidget.FieldType.TEXT,
  label: "Document Number",
});

sublist.setSublistValue({ id: "internalid", line: 0, value: "123345" });
sublist.setSublistValue({ id: "documentnumber", line: 0, value: "123456" });
This code creates a Suitelet form with a sublist. The sublist is populated with the results of a saved search. The
setSublistValue
method is used to set the values of the sublist. While it is possible to use a User Event (UE) script to modify the behavior of existing records or forms, it is not typically used to display a sublist of a saved search. UE scripts are triggered by events on records, and are not designed to create custom pages or sublists. ****** 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.851352453
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.850139558
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.844873488
Please provide your feedback on this answer.