module function · N/search
duplicates()
search.duplicates(options)
Performs a search for duplicate records based on the duplicate detection configuration for the account.
- Implementation
- Not started
- Design
- Open for proposals suggest how it should read
A
suitescript api
1search.duplicates({2 type: /* enum, required */,3 fields: /* Object, optional */,4 id: /* number, optional */5});
| Parameter | Type | Required | Description |
|---|---|---|---|
| options.type | enum | required | The search type that you want to check for duplicates. Use the search.Type enum for this parameter. The type you specify must correspond to a record type that supports duplicate record detection (for example, customer, lead, prospect, contact, partner, and vendor records). |
| options.fields | Object | optional | A set of key-value pairs used to detect duplicates. The keys are internal ID names of the fields used to detect duplicates. You can specify fields such as companyname, email, name, phone, address1, city, state, and zipcode. For example, to detect duplicates based on the value of the email field, use 'email' : 'sample@test.com' . Use this parameter to specify the fields (and their values) to use to detect duplicates. If you are searching for duplicates based on fields that appear on a certain record type, this parameter is required. If you are searching for duplicates of a specific record (of the specified type), use the options.id parameter instead. |
| options.id | number | optional | Internal ID of an existing record. Use this parameter to specify a record to detect duplicates of. The duplicate record detection settings in the account determine which fields are used to detect duplicates of the specified record. If you are searching for duplicates of a specific record (of the specified type), this parameter is required. If you are searching for duplicates based on fields that appear on a certain record type, use the options.fields parameter instead. |
B
mynt syntax
No Mynt syntax yet.
Nothing in the language compiles to search.duplicates(options) today. How should it read?
C
community proposals
Competing syntax for duplicates, from GitHub Discussions. Select two or more to compare them side by side.
Loading proposals from GitHub…
D
suggest an alternative
Write the Mynt you wish you could write.
A good proposal shows the syntax, the SuiteScript it should become, and argues for it: why it is clearer, how it fits the rest of the language, what it makes harder.
- Clarity. Does it say what happens, without ceremony?
- Consistency. Does it read like
load,saveandRef[field]? - Expressiveness. Does it cover the cases people actually write?
- Honesty. Does it hide a NetSuite cost, such as governance, that a reader should see?