Skip to content

Instantly share code, notes, and snippets.

View App.js
var context;
var web;
var user;
// This code runs when the DOM is ready and creates a context object which is needed to use the SharePoint object model
function sharePointReady() {
context = SP.ClientContext.get_current();
web = context.get_web();
View gist:5572799
<%-- The markup and script in the following Content element will be placed in the <head> of the page --%>
<asp:Content ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
<script type="text/javascript" src="../Scripts/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="/_layouts/15/sp.runtime.debug.js"></script>
<script type="text/javascript" src="/_layouts/15/sp.debug.js"></script>
<!-- Add your CSS styles to the following file -->
<link rel="Stylesheet" type="text/css" href="../Content/App.css" />
<!-- Add your JavaScript to the following file -->
girishraja / CrmData.svc.cs
Last active Dec 17, 2015
Proxy Code for CRMOnline - SharePoint Online BCS Sample
View CrmData.svc.cs
public class CrmData : DataService<Xrm.XrmServiceContext>
// This method is called only once to initialize service-wide policies.
public static void InitializeService(DataServiceConfiguration config)
//config.SetEntitySetAccessRule("*", EntitySetRights.AllRead);
config.SetEntitySetAccessRule("AccountSet", EntitySetRights.AllRead);
config.SetEntitySetAccessRule("ContactSet", EntitySetRights.AllRead);
config.SetServiceOperationAccessRule("*", ServiceOperationRights.All);
config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;