How to customise the customer drop down field on p...
# ask-stanley-ai
m
How to customise the customer drop down field on project record ? I want to customize like the item sublist field on customize form
c
AI generated answer (using internal Slack threads):
To customize the customer drop-down field on a project record similar to the item sublist field on a customized form, you can follow these steps: 1. Create a new custom field of type List/Record (Item) on your custom record. This will serve as your drop-down field. 2. Create a child custom record for the sublist level. This will allow you to have a fully-editable sublist in a Custom Record Subtab. 3. Use a beforeLoad user event to add an ad hoc field to the form. This field will be populated using a search. 4. The search should be set up to filter the data you want with the customer as a filter. This will allow the drop-down to only display the unique inventory items on any sales order for the customer. Here is a pseudo-code example of how you might set up the beforeLoad user event:
Copy code
javascript
function beforeLoad(type, form) {
    if (type == 'edit' || type == 'create') {
        var field = form.addField({
            id: 'custpage_myfield',
            type: 'select',
            label: 'My Field'
        });
        var searchResults = performMySearch(); // replace with your search function
        for (var i = 0; i < searchResults.length; i++) {
            field.addSelectOption({
                value: searchResults[i].getValue('internalid'),
                text: searchResults[i].getValue('name')
            });
        }
    }
}
Remember to replace
performMySearch()
with your actual search function that retrieves the unique inventory items on any sales order for the customer. ****** 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.849748373
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.846588194
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.845733345
Please provide your feedback on this answer.