This is a migrated thread and some comments may be shown as answers.

Call Telerik APIs from a Sharepoint Form

1 Answer 44 Views
Integration with other products
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Bob
Top achievements
Rank 1
Bob asked on 06 Dec 2015, 06:55 PM

Hello, we are currently using Telerik to create network directories from ASP interfaces and in the code below, i'm trying to use a few of those UI API components of the UI interface, to create a new network directory from a Sharepoint Form, so any suggestions on how to use the following APIs or suggestions on using any other available Telerik APIs would be much appreciated!  

<script type="text/javascript">

function PreSaveItem()  //Sharepoint method
{
  alert("1");
  getData();
  return true;
}
function getData()  // existing Telerik APIs from User Interface below
{
  alert("2");
  var def = $.Deferred();
  fhfaToken.getUserToken().done(function (eToken) {

    var d = {};

    d['parentObjectID'] = 1550109;
    d['objectName'] = “Test5”;
    d['objectTypeID'] = “”;

    $.ajax({
        url: "http://apps.test.gov/_services/webdocs/webdocs.ashx?action=object.CreateFolder",
        data: d,
        headers: { "X-TEST-UserToken": eToken.userToken },

        type:"POST"
    }).done(function(ajaxData) {
        def.resolve(ajaxData.d);
    }).fail(function (jqXHR, textStatus, errorThrown) {
        def.reject(jqXHR, textStatus, errorThrown);
    });
  });

  return def.promise();
}

var fhfaToken = {
    alert("3");
    userToken: "",
    userId: "",
    getUserToken: function () {
        var that = this;
        var def = $.Deferred();
        if (that.userToken !== "") {
            def.resolve(that);
            return def.promise();
        }   
        $.ajax({
            url: "http://[apps.test.gov]/_Services/Authentication/UserToken.ashx",
            dataType: "jsonp"
        }).done(function (eToken) {
            that.userToken = eToken.userToken;
            that.userId = eToken.userId;
            def.resolve(that);
        }).fail(function (jqXHR, textStatus, errorThrown) {
            def.reject(jqXHR, textStatus, errorThrown);
        });
        return def.promise();
    }
}
</script>

1 Answer, 1 is accepted

Sort by
0
Doroteya
Telerik team
answered on 09 Dec 2015, 01:30 PM
Hello rc,

Thank you for contacting us.

Based on the provided information I was unable to completely understand the situation on your side. Therefore, I would kindly ask you to provide me with the following additional information:

1. Do you experience any errors? If so, what are their text messages?
2. Do you use the Telerik Data Access product?
3. Which controls' suite do you use on your side: Telerik UI for ASP.NET AJAX, or Telerik Kendo UI, or else?
4. What is the architecture of your application (the structure of the solution and the roles of the projects in the application)?

Thank you in advance for your understanding and cooperation.

Regards,
Doroteya
Telerik
 
Check out the latest announcement about Telerik Data Access vNext as a powerful framework able to solve core development problems.
Tags
Integration with other products
Asked by
Bob
Top achievements
Rank 1
Answers by
Doroteya
Telerik team
Share this question
or