I need to update the opportunity but I only have the contact Id. So if I can get the opportunity Id I can update the opportunity.
Xrm.WebApi.retrieveMultipleRecords("opportunity", "?$select=opportunityid&$filter=(_contactid_value eq 25a17064-1ae7-e611-80f4-e0071b661f01 or _parentcontactid_value eq 25a17064-1ae7-e611-80f4-e0071b661f01)").then(
function success(results) {
console.log(results);
for (var i = 0; i < results.entities.length; i++) {
var result = results.entities[i];
// Columns
var opportunityid = result["opportunityid"]; // Guid
}
},
function(error) {
console.log(error.message);
}
);
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,269 Super User 2024 Season 2
Martin Dráb 230,198 Most Valuable Professional
nmaenpaa 101,156