2012-03-01 2 views
8

SalesForce API (엔터프라이즈 WSDL)를 통해 레코드를 업데이트하려고합니다.SalesForce API에서 업데이트가 작동하지 않습니다.

아래의 코드는 정상적으로 실행되고 반환 된 saveResult는 작업이 성공했다고 표시합니다.

그러나 SalesForce를 보면 레코드가 업데이트되지 않았습니다. 내가 생각할 수있는 유일한 것은 내가 잘못된 ID를 사용하고 있다는 것입니다. 그러나 나는 5 배로 이것을 체크하고 다시 체크 한 다음 다시 체크했습니다.

이전에 이런 사람이 발생 했습니까? 누군가가 내가 아마 API에 Update 메서드를 호출 닷넷을 사용하는 경우

sforce.Participant__c updateParticipant = new sforce.Participant__c(); 

     updateParticipant.Id = participant.Id.Length == 15? participant.Id : participant.Id.Substring(0, 15); 

     if (updateType == "pre") 
     { 
      updateParticipant.Manual_Download_Date__c = DateTime.Now; 
      updateParticipant.Manual_Download__c = true; 
     } 
     else if (updateType == "post") 
     { 
      updateParticipant.Post_Class_Manual_Download__c = true; 
      updateParticipant.Post_Class_Manual_Downloaded_Date__c = DateTime.Now; 
     } 

     sforce.SaveResult[] result = SFLib.sfdc.update(new sforce.sObject[] { updateParticipant }); 
     if (result == null || result.Length <= 0) 
      return false; 
     else 
     { 
      if (result[0].success == true) 
       return true; 
      else 
       throw new Exception("Update participant failed", new Exception(result[0].errors[0].message)); 
     } 
+0

아래 질문에 답을 입력하고이 질문을 공개하지 않으려면 답변을 수락하십시오. – mmix

답변

18

:-) 곳했습니다하는 바보 같은 실수를 지적 할 수있는 경우 또는, 내가 그렇게 기뻐할 것입니다, 당신은 설정해야 * fieldname__c 명시된 * 필드를 명시 적으로. 예 :

updateParticipant.aDateField_StartDate__c = DateTime.Now; 
updateParticipant.aDateField_StartDate__cSpecified = true; 
+2

일부 유형 (부울/숫자/날짜)의 경우에만 해당하지만 문자열에는 적용되지 않습니다. – superfell

+0

만약 내가 할 수만 있다면 나는 다시 이것을 투표하겠다. 나는 머리카락을 꺼내왔다. – Miles

+2

우리는 비누 클라이언트가 왜 CaseComment.isPublished를 true로 설정할 수 없었는지 추적하려고 노력했다. @RobD에게 감사드립니다. 이 문서는 SFDC Soap API 개발자 가이드 http://www.salesforce.com/us/developer/docs/api/index_Left.htm#StartTopic=Content/implementation_considerations의 'Implementation Considerations'페이지 하단에 있습니다. htm? SearchType = Stem – cropredy

관련 문제