2016-06-09 52 views
0

我使用下面的代碼創建的任命,「500內部服務器錯誤」如何從Android MS CRM SDK創建Appoinment?

我加各領域的檢查

Appointment objappointment = Appointment.build() 
      .setSubject("Android sub") 
      .setDescription("dis from device") 
      .setRegardingObjectId(new EntityReference("account", UUID.fromString("0717b8e2-d00a-e611-8115-c4346bdd11d1"))) 
      .setOwnerId(new EntityReference("systemuser", UUID.fromString("3edb272d-2da7-4c89-9350-2f4bd4e1762b"))) 
      .setStateCode(new OptionSetValue(0)) 
      .setNew_Latitude(23.7845) 
      .setNew_Longitude(73.6574) 
      .setNew_City("Surat") 
      .setActualStart(mDate.getTime()) 
      .setActualEnd(mDate1.getTime()) 
      .setNew_ZipPostalCode("380060") 
      .setNew_Street1("Street1") 
      .setNew_Street2("Street3") 
      .setNew_street3("Street3") 
      .setNew_StateProvince("Gujarayt") 
      .setNew_CountryRegion("India") 
      .setNew_Latitude(23.7845) 
      .setNew_Longitude(73.6574) 
      .setStatusCode(new OptionSetValue(0)) 
      .setPriorityCode(new OptionSetValue(2)); 


try { 
      RestOrganizationServiceProxy restService = new RestOrganizationServiceProxy(mOrgService); 
      restService.Create(objappointment,new Callback<UUID>() { 
       @Override 
       public void success(UUID uuid, Response response) { 
        log("sucess", uuid.toString()); 

          } 

       @Override 
       public void failure(RetrofitError error) { 
        displayError(error.toString()); 
        log("error", error.toString()); 
       } 
      }); 
     } 
     catch(Exception ex) { 
      displayError(ex.getMessage()); 
      log("msg",ex.toString()); 
     } 

另一個實體創建成功地使用上面的代碼只是得到錯誤「的會面」

+1

你在問什麼? – marthursson

回答

0

您能否獲得有關異常的更多詳細信息? 500可能是任何例外。至少你知道請求命中了服務器,並且它在CRM服務器端失敗。也許一個插件或類似的東西引發了異常。

我認爲你必須傳遞給誰的註釋將被鏈接到OBJECTID(客戶,聯繫人,或任何...)

那是內部部署還是在線CRM?如果OnPremise,您可以啓用web.config中的includeExceptionDetailInFaults屬性,至少可以獲得有關異常的更多詳細信息....

+0

我也嘗試使用下面的代碼,但得到相同的錯誤約會objappointment = Appointment.build() .setSubject(「Android子」) .setDescription(「dis from device」) .setRegardingObjectId(new EntityReference(「contact」,UUID .fromString(「41c73e31-a128-e611-80ec-c4346bdc5eb1」))) .setOwnerId(new EntityReference(「systemuser」,UUID.fromString(「afed4640-505a-476d-97f5-cb16fb0ad9de」))) .setStateCode新的OptionSetValue(0)); – frnd

+0

您無法在創建時傳遞StateCode ....無論如何,最好啓用includeExceptionDetailInFaults設置,否則將很難找到根本原因。你有沒有使用CRM?檢查事件查看器... – Jordi