SP List Ajax call web service return value assign to SP list textbox

Shri Shankran 1 Reputation point
2020-08-18T05:48:53.237+00:00

Test help ajax call web service to assign return value into Textbox

SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,608 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Jerryzy 10,571 Reputation points
    2020-08-19T02:51:11.55+00:00

    Hi @Shri Shankran ,

    Per my understanding, "http://services.myportal.com/employee/advisees" should be an external domain custom web service which is outside SharePoint Online.

    Then it's necessary to add Access-Control-Allow-Origin header in your custom web service, for example here is a demo to add custom header in .NET Web API Web.Conig:

    Access-Control-Allow-Origin Header and the ASP.NET Web API

    SharePoint CORS fix

    Here is a similiar question for your reference:

    AJAX POST REST call generates CORS error


    If the response is helpful, please click "Accept Answer" and upvote it.


  2. Jerryzy 10,571 Reputation points
    2020-08-20T03:58:05.307+00:00

    Hi @ShridharHegde-2034,

    The total count of array data can be got from the data in function(data), you can try to log it to browser Developer Tool using console.log(data) so that it's available to
    check the detailed struct for data object.

    It should be data.d.results.length similar as SharePoint Rest API. (maybe no d/results in data object as it's a custom web service)

    In additional, I found your account is different with the account which post the original question, you can switch to the original account rather than use another account to response ther reply.


    If the response is helpful, please click "Accept Answer" and upvote it.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.