2017-04-19 3 views
0

임 프로그래밍 리드 개체를 만들려고하고 난 다이나믹 CRM의 특별한 필드에 더 이상 특별한 메시지 2016역학 CRM 2016 작성 및 리드 자격 프로그래밍 #

그래서, 내가 데이터를 검색이 없음을 읽고 c를 그리고 다이나믹 CRM 서버에서 난 그냥 아래와 같은 특별한 메시지를 사용하지 않고, annother CRM 서버에 삽입 :

account["statecode"] = new OptionSetValue(1); //inactive 
account["statuscode"] = new OptionSetValue(2); //inactive 

문제는 값이 "1"statecode 느릅 나무에서 의미가 공인 인이 리드 기록이다 값이 "3"인 statuscode도 공인을 의미합니다. 내가 삽입을 시도

어떤 방법, 흐르는 메시지와 함께 제기 오류 : 참고하시기 바랍니다

3 is not a valid status code for state code LeadState.Open

, LeadState.Open 리드 상태 내가 전에 언급으로, 비록 값이 "0"이 "1"이다.

나는 exatley 무엇이 문제인지 모른다.

미리 감사드립니다.

답변

2

SDK에 설명 된대로 QualifyLeadRequest을 사용해야합니다. 이 메시지는 SetState과 달리 사용 중단으로 표시되지 않았습니다. 자격 리드 워크 플로는 계정, 연락처 및 기회 레코드를 만들고 선택적으로 연결하기 때문에 설정 상태 프로세스보다 복잡합니다.

다음은 인 opportunity을 생성하기위한 리드 예선 SDK의 예입니다.

  // Qualify the second lead, creating an opportunity from it, and not 
      // creating an account or a contact. We use an existing account for the 
      // opportunity customer instead. 
      var qualifyIntoOpportunityReq = new QualifyLeadRequest 
      { 
       CreateOpportunity = true, 
       OpportunityCurrencyId = currencyId, 
       OpportunityCustomerId = new EntityReference(
        Account.EntityLogicalName, 
        _accountId), 
       Status = new OptionSetValue((int)lead_statuscode.Qualified), 
       LeadId = new EntityReference(Lead.EntityLogicalName, _lead2Id) 
      }; 

      var qualifyIntoOpportunityRes = 
       (QualifyLeadResponse)_serviceProxy.Execute(qualifyIntoOpportunityReq); 
      Console.WriteLine(" The second lead was qualified."); 

      foreach (var entity in qualifyIntoOpportunityRes.CreatedEntities) 
      { 
       NotifyEntityCreated(entity.LogicalName, entity.Id); 
       if (entity.LogicalName == Opportunity.EntityLogicalName) 
       { 
        _opportunityId = entity.Id; 
       } 
      } 

이 코드를 작성한 예제에는 https://msdn.microsoft.com/en-us/library/hh547458.aspx이 있습니다.

+0

좋습니다. 감사합니다. –