Показать сообщение отдельно
Старый 14.11.2011, 14:50   #4  
Omalinka is offline
Omalinka
Участник
 
16 / 10 (1) +
Регистрация: 25.02.2011
Адрес: Russia
Скопировала библиотеку sample_/Scripts/SDK.REST.js к себе в solution и пытаюсь проапдейтить custom entity "steer_participant" аналогично тому, как приведено в примере http://technet.microsoft.com/en-us/l...taOperationsJS.
Но ничего не просиходит, что я делаю не так..?

Код:
function updateParticipant(ParticipantId) {
	 var participant = {};
	 alert("Changing the participant status");
	 participant.steer_attended = true;


	 SDK.REST.updateRecord(
		 ParticipantId,
		 participant,
	     "steer_participant",
	     function () {
	      alert("The account record changes were saved");
	      deleteParticipant(ParticipantId);
	     },
	     errorHandler
	   );
	}

function deleteParticipant(ParticipantId) {
 if (confirm("Do you want to delete this account record?")) {
  writeMessage("You chose to delete the account record.");
  SDK.REST.deleteRecord(
       ParticipantId,
       "steer_participant",
       function () {
        writeMessage("The account was deleted.");
        enableResetButton();
       },
       errorHandler
     );
 }
 else {
  var li = document.createElement("li");

  var span = document.createElement("span");
  span.innerText = "You chose not to delete the record. You can view the record ";

  var link = document.createElement("a");
  link.href = SDK.REST._getServerUrl() + "/main.aspx?etc=1&id=%7b" + AccountId + "%7d&pagetype=entityrecord";
  link.target = "_blank";
  link.innerText = "here";

  li.appendChild(span);
  li.appendChild(link);
  output.appendChild(li);
  enableResetButton();

 }
}