2014-11-09 53 views
0

我已經使用服務器端代碼編寫代碼,以便在Sharepoint 2013中設置由BCS公開的外部數據。這裏是代碼:如何在Sharepoint 2013 Online中設置Business Connectivity Service(BCS)公開的外部數據?

public void SetBusinessDataValue(object spItem,object spField, string value) 
    { 
     try 
     { 
      SPBusinessDataField businessDataField = spField as SPBusinessDataField; 
      SPListItem spListItem = spItem as SPListItem; 

      businessDataField.ParseAndSetValue(spListItem, value); //Set your value here 
      string fieldName = ((SPField)spField).Title; 
      spListItem[businessDataField.RelatedField] = spListItem.Fields[fieldName]; 
     } 
     catch (Exception ex) 
     { 
      Logging.LogWriteLine("Error in method SetBusinessDataValue(). Failed to set the business data value", ex); 
     } 
    } 

它工作正常。但是,我無法編寫代碼以使用SharePoint Client Object模型在SharePoint 2013 Online中設置外部數據。有人可以幫助解決我的問題嗎?

回答

1

您使用沙盒解決方案嗎?如果是,您可以在沙盒解決方案中編寫相同的服務器代碼。請!嘗試一下。

相關問題