locked
retreive multiple using SDk.jqury to Check existing accountNumber RRS feed

  • Question

  • Hi there

    I have requirment to  check  accountnumber for existing record by useing SDK.jquery Library and use Retreive mulitple method to write a function to check for existing record

    retrieveMultipleRecords: function (type, options, successCallback, errorCallback, OnComplete)

    how to specify Parameters

    thanks


    • Edited by CRM20133 Monday, September 30, 2013 8:16 PM
    Monday, September 30, 2013 8:07 PM

Answers

  • Try this:

    var AccountNumber = Xrm.Page.getAttribute("accountnumber").getValue();
    SDK.JQuery.retrieveMultipleRecords("Account", "select=AccountNumber&$filter=AccountNumber eq '" + AccountNumber + "'&$top=1", function (results) {
        if (results.length > 0) {
            alert("duplicate");
        }
    }, function (error) {
        alert(error);
    }, function () {});


    Jason Lattimer
    My Blog -  Follow me on Twitter -  LinkedIn

    Tuesday, October 1, 2013 2:54 AM
    Moderator