diff --git a/actions/index.js b/actions/index.js index a0a2c446..3b79464e 100644 --- a/actions/index.js +++ b/actions/index.js @@ -234,3 +234,35 @@ export const createCase = (lpaType, appealType) => { // } // }; // req.send(); + + +// //jquery version to get case number from an lpa and an appeal type +// var entity = {}; +// entity.caseorigincode = 3; +// entity["customerid_account@odata.bind"] = "/accounts(c75f6f84-49da-eb11-aabd-00224800d1bd)"; +// entity.pinswg_appealcasetype = 846040004; + +// $.ajax({ +// type: "POST", +// contentType: "application/json; charset=utf-8", +// datatype: "json", +// url: Xrm.Page.context.getClientUrl() + "/api/data/v8.2/incidents", +// data: JSON.stringify(entity), +// beforeSend: function(XMLHttpRequest) { +// XMLHttpRequest.setRequestHeader("OData-MaxVersion", "4.0"); +// XMLHttpRequest.setRequestHeader("OData-Version", "4.0"); +// XMLHttpRequest.setRequestHeader("Accept", "application/json"); +// XMLHttpRequest.setRequestHeader("Prefer", "odata.include-annotations=\"*\",return=representation"); +// }, +// async: true, +// success: function(data, textStatus, xhr) { +// var uri = xhr.getResponseHeader("OData-EntityId"); +// var regExp = /\(([^)]+)\)/; +// var matches = regExp.exec(uri); +// var newEntityId = matches[1]; +// //Handle returned attributes +// }, +// error: function(xhr, textStatus, errorThrown) { +// Xrm.Utility.alertDialog(textStatus + " " + errorThrown); +// } +// }); \ No newline at end of file