-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy path_sfDuplicateRulesGet.js
More file actions
31 lines (28 loc) · 975 Bytes
/
_sfDuplicateRulesGet.js
File metadata and controls
31 lines (28 loc) · 975 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
'use strict';
// Initialize required modules
const sObjectAPIs = require('../../lib/apis/sfdc/sObject');
/**
* @function _sfDuplicateRulesGet
* @description Attempts to retrieve the collection of duplicateRules for a Salesforce Org
*
* @param {connection} authConnection Represents the connection that should be used to perform the getQuery
* @param {String} profileObject Describes the profile objectType (Contact or Account) to search for
* @returns {Promise} Returns the collection of duplicateRules found
*/
module.exports = (authConnection, profileObject) => sObjectAPIs.search(
authConnection,
`
SELECT Id,
DeveloperName,
SobjectType,
MasterLabel,
IsActive,
IsDeleted,
CreatedDate
FROM DuplicateRule
WHERE SobjectType = '${profileObject}'
ORDER
BY SobjectType,
CreatedDate ASC
`
);