Hi,
trying to make a web request after a form was saved, but it looks like the form is being closed before the request was sent.
fd.spSaved(function (result) {
var postURL = “https://…my web service url…”;
var data = JSON.parse(’{“partnerID”:"’ + Dialog.getArgs().partnerID + ‘",“ticketID”:"’ + Dialog.getArgs().parentID + ‘",“title”:"’ + fd.field(“Title”).value + ‘",“author”:"’ + _spPageContextInfo.userDisplayName + ‘",“userId”:"’ + _spPageContextInfo.userId + ‘"}’);
jQuery.ajax({
url: postURL,
method: “POST”,
headers: {
“Accept”: “application/json”,
“Content-Type”: “application/json”
},
data: JSON.stringify(data),
success: function () {
console.log(“call successful.”);
}
});
});
Am I doing it the wrong way?