title: Custom Field in SharePoint 2013
body: <p>I have been entrusted with migrating the existing custom plugin from SharePoint 2010 to 2013. SharePoint 2013 solution should create a custom column for which the data should be fetched from our product (application) using webservice. With 2010, the js file location and the function has been called from fldtypes_xxxx.xml file using the renderpattern. But with 2013, since the UI has changed, I'm not able to link the JS file. Hence I had to use the JSLink property. Referred to the below msdn article and tried the same.</p>
  
  <p><a href="http://msdn.microsoft.com/en-us/library/jj220061%28v=office.15%29.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/jj220061%28v=office.15%29.aspx</a></p>
  
  <p>Now I would like to make a webservice call from the JS file. I need to get the document's information like the listid, itemID and send it to our custom webservice which handles the request which inturn should send a webservice call to our external application and get the data for the appropriate document in sharepoint library.</p>
  
  <p>Please guide me on this.</p>
  
  <p>How to add a call from the below function.</p>
  
  <pre><code>(function () {
      var favoriteColorContext = {};
  
      favoriteColorContext.Templates = {};
      favoriteColorContext.Templates.Fields = {
          "FavoriteColorField": {
              "View": favoriteColorViewTemplate
          }
      };
  
      SPClientTemplates.TemplateManager.RegisterTemplateOverrides(
          favoriteColorContext
          );
  })();
  
  function favoriteColorViewTemplate(ctx) {
      var color = ctx.CurrentItem[ctx.CurrentFieldSchema.Name];
      return "&lt;span style='background-color : " + color +
          "' &gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;" + color;
  }
  </code></pre>