locked
Jquery Create Record is not Working in Chrome RRS feed

  • Question

  • Hello Expert,

                   i am creating an email record using SDK.Jquery. It is working fine in IE, Safari, Mozila but it's not working in CHROME. I took the library from CRM 2011 SDK 5.0.16

    Here is my code below. please suggest where i am wrong

     SDK.JQuery.createRecord(
                                       emailRecord,
                                       "Email",
                                       function (emailRecord) {
                                           //debugger;
                                           alert("Email ID : "+emailRecord.ActivityId);
                                           activityId = emailRecord.ActivityId;                                       
                                           CreateActivityparty(activityId, OwnerId, "systemuser", 1); //set from address
                                           CreateActivityparty(activityId, userId, "contact", 2);//set to address

                                       },
                                       errorHandler
                                     );
                                       

    Thank you


    saroj

    Wednesday, August 7, 2013 9:36 AM

Answers

  • Hello the problem is resolved. I added

    async:false after datatype:"json" in SDK .Jquery.CreateRecord method

    the compete method is like below

     $.ajax({ type: "POST",
                contentType: "application/json; charset=utf-8",
                datatype: "json",
                async:false,
                url: this._ODataPath() + type + "Set",
                data: jsonEntity,
                beforeSend: function (xhr) {
                    //Specifying this header ensures that the results will be returned as JSON.             
                    xhr.setRequestHeader("Accept", "application/json");
                },
                success: function (data, textStatus, xhr) {
                    successCallback(data.d);
                },
                error: function (xhr, textStatus, errorThrown) {
                    errorCallback(SDK.JQuery._errorHandler(xhr));
                }
            });


    saroj

    Wednesday, August 7, 2013 11:40 AM