how can I search an address by address internal id...
# ask-stanley-ai
l
how can I search an address by address internal id in a saved search? show examples for the ui and scripts
c
AI generated answer (using internal Slack threads):
To search an address by address internal id in a saved search, you can create a search on the entity (customer, vendor, etc.) and add the address internal id as a column. Here is an example of how you can do this in SuiteScript:
Copy code
javascript
var shipaddressSearch = search.create({
    type: recordtype,
    filters: [['internalid', 'is', recordid]],
    columns: [
        search.createColumn({
            name: "internalid",
            join: "Address",
            label: "Internal ID"
        }),
        search.createColumn({
            name: "addressinternalid"
        })
    ]
});

var shipipingAddressResults = shipaddressSearch.run().getRange({
    start: 0,
    end: 1000
});

shipipingAddressResults.forEach(function (shipaddress) {
    console.log("EXTERNAL IDDDD", shipaddress.getValue("addressinternalid"));
    if (shipaddress.getValue("addressinternalid") == warehouseLocation) {
        warehouseLocation = shipaddress.getValue({ name: 'internalid', join: 'Address' });
    }
});
In this script,
recordtype
is the type of the record you are searching (e.g., 'customer'), and
recordid
is the internal id of the record. The script creates a search that returns the internal id of the address and the address internal id. It then loops through the results and logs the address internal id. If the address internal id matches a specific value (
warehouseLocation
in this example), it updates that value with the internal id of the address. For the UI, you can create a saved search on the entity and add the address internal id as a column. Here are the steps: 1. Go to Reports > Saved Searches > All Saved Searches > New. 2. Select the type of the entity (e.g., Customer). 3. In the Criteria subtab, add a filter for the internal id of the entity. 4. In the Results subtab, add a column for the address internal id. 5. Save and run the search. ****** 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.835419
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.83481735
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.83113277
Please provide your feedback on this answer.