我有以下代码:
mainfunction: function () {
var variable = false;
SDK.REST.CreateRecord(
"entity",
"$select=field",
function1 (theResults) {
if (theResults && theResults.length > 0) {
alert("It works");
variable = true;
}
},
function (error) {
Xrm.Page.ui.setFormNotification(error, "ERROR", "ERROR_NOTE");
},
function () {
// Do something
}
);
alert(variable);
}
显示“它工作正常”,但在最后一次通话中变量仍为假,为什么?感谢