
ManagerID to Manager
This rule works fine if I use OrientDB as the back end, but doesn't work when I use MS-SQL as the back end. Perhaps an issue with OpenIDM?(function () {
try {
if (!source || !source.length) {
return null;
}
var
orgId = "00DA0000000gukE",
link,
qry = openidm.query("system/AD/account", {
"query": {
"Equals": {
"field": "distinguishedName",
"values": [ source ]
}
}
});
if (!qry.result || qry.result.length !== 1) {
return null;
}
link = openidm.query("repo/link", {
"_queryId": "links-for-firstId",
"linkType": "ADUsers_SalesForceUsers_" + orgId,
"firstId": encodeURIComponent(qry.result[0].objectGUID)
});
if (!link.result || link.result.length !== 1) {
return null;
} else {
return link.result[0].secondId;
}
} catch ( e ) {
return null;
}
}());