Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for duplicate detection in Create #13

Open
hajekj opened this issue Jan 13, 2023 · 2 comments
Open

Support for duplicate detection in Create #13

hajekj opened this issue Jan 13, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@hajekj
Copy link

hajekj commented Jan 13, 2023

Xrm.WebApi.online.execute supports passing property suppressDupeDetection which enables duplicate detection. It is not documented, but works. Would you be interested in adding this to the DRB?

var record = {};
record.name = "T"; // Text var createRequest = {
    etn: "account",
    payload: record,
    suppressDupeDetection: false,
    getMetadata: function () { return { boundParameter: null, parameterTypes: {}, operationType: 2, operationName: "Create" }; }
}; Xrm.WebApi.online.execute(createRequest).then(
    function success(response) {
        if (response.ok) {
            console.log("Record created");
        }
    }
).catch(function (error) {
    console.log(error.message);
});
@GuidoPreite
Copy link
Owner

It should be the equivalent of the MSCRM.SuppressDuplicateDetection header but as you wrote is not documented.
The MSCRM.SuppressDuplicateDetection is already added for the other syntaxes (Fetch, jQuery, XHR) by making the Detect Duplicates option to Yes.
What I can eventually do is to modify the comment
// WARNING: Xrm.WebApi doesn't support Detect Duplicates
to indicate that suppressDupeDetection can be used but because is not documented I am not inclined to add it. Can you let me know where you found this option? also by DM. Thanks

@GuidoPreite GuidoPreite self-assigned this Jan 13, 2023
@GuidoPreite GuidoPreite added the enhancement New feature or request label Jan 13, 2023
@hajekj
Copy link
Author

hajekj commented Jan 18, 2023

Simply by going through the Microsoft's compiled JavaScript. We have been in need to modify the duplicate behavior, so found out that way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants