Error while saving record in SharePoint 2013 through jQuery

Dear Support,
I had successfully created provider hosted app and deployed on SharePoint 2013 online site, in my project I created
orderservice.asmx.cs web service and write a code for save record on SharePoint 2013 online list as I mentioned below and calling on App1.js file.
But I am facing error when I am saving record on SharePoint 2013 list on button click event
“500 Internal Server Error
<! DOCTYPE html>”
<html>
OrderService.asmx.cs
Public
int InsertOrder (Order
orderRecord)
pwd.MakeReadOnly();
clientContext.Credentials = new
SharePointOnlineCredentials (myUserName, pwd);
try
Web oWeb = clientContext.Web;
ListCollection lists = oWeb.Lists;
List oOrderlist = lists.GetByTitle("Order");
clientContext.Load<ListCollection>(lists);
clientContext.Load<List>(oOrderlist);
ListItemCreationInformation listItemCreationInfo
= new
ListItemCreationInformation();
var listItem = oOrderlist.AddItem(listItemCreationInfo);
     listItem["Title"]
= orderRecord.OrderProfile;
listItem["Special_x0020_Instruction"]
= orderRecord.Instruction;
listItem ["Customer"] = orderRecord.CustomerId;
listItem.Update();
       clientContext.ExecuteQuery();
return 1;
catch
return -1;
App1.JS
$("#Save").click(function
debugger;
var OrderProfile = $('#orderprofile').val();
var CustomerId = $('#exCustomerlist').jqxComboBox('getSelectedItem');
var Instruction = $('#instruction').val();
$.ajax ({
url: location.pathname + "OrderService.asmx/InsertOrder",
type: "POST",
dataType: "json",
data: "{OrderProfile:'" + OrderProfile
+ "', CustomerId:'" + CustomerId.value
+ "', Instruction:'" + Instruction
+ "}",
contentType: "application/json; charset=utf-8",
beforeSend: function (XMLHttpRequest) {
//Specifying this header ensures that the results will be returned as JSON.
XMLHttpRequest.setRequestHeader("Accept",
"application/json");
success: function (response) {
$(".errMsg ul").remove();
var myObject = eval('('
+ response.d + ')');
if (myObject > 0) {
                                     alert(myObject);
$(".errMsg").append("<ul><li>Data
saved successfully</li></ul>");
else {
$(".errMsg").append("<ul><li>Opppps
something went wrong.</li></ul>");
$(".errMsg").show("slow");
clear();
error: function (response) {
alert(response.status + ' ' + response.statusText
+ ' ' + response.responseText);
would request for your support.
Regards,
Akhilesh

Hi,
Can you call your web service using jQuery not in an app successfully?
As the error message suggests, it might be an error on the server side.
I suggest you do a simple test to check whether you can call the web service using jQuery.
Here are two links would provide more information about troubleshooting this error for your reference:
http://sadomovalex.blogspot.com/2013/08/return-json-from-asmx-when-call-it.html
http://www.codeproject.com/Tips/761116/Troubleshooting-an-Issue-With-Calling-an-asmx-Web
Feel free to reply with the test result if the issue still exists.
Best regards
Patrick Liang
TechNet Community Support

Similar Messages

  • Error while saving record "User:johndoe":     Error -14071

    I have added my augmented users from the AD server. When I select user and to apply a setting under Preferences I get this on attempting an "Apply", Error while saving record "User:johndoe":Error -14071. I'm authenticating to my LDAP not AD/All Domains.
    I have the server bound correctly to the AD server. Bound to AD, then promoted to OD master.
    Tried WGM from another Mac, same error.
    I recall my AD admin extending the ad schema last year for OS X 10.4.
    Thoughts? Thanks.

    Thanks David and Mabel, and all for the suggestions. I did go through "Leveraging Active..." prior to posting. I did try your method of canceling the authorization to WGM and viewing Directories. I would select a user from this method and try to apply something from MCX, but still got the -14070 error. Yes, I do have my client bound 1st OD, 2nd AD, with OD first on the search policy for the client.
    I though I had solved my issue by authenticating to WGM and LDAP. Then selecting Groups and the Members tab, I define an OD group and select that group. I can then click the "+" towards the right of the window. Then select my AD there which populates. I can add my AD groups or single users to my OD group. Then I'm able to apply MCX settings. But, no "blue" circle next to the group's silhouette. How is my method possibly incorrect?
    Also, at some point I unbound my client from AD and it seems the client is ok with getting AD info off my OD server. Example, my AD sharepoint mounts for PHD.
    But, I do have a pause of 20 secs. are more when logging into the client as well as accessing applications. Side effect of my method?

  • Error while crawling LOB contents SharePoint 2013

    Error while crawling LOB contents SharePoint 2013
    I have Configured the BDC Service application using SQL external content. The connection was successful and I am able to see the external content in the List "BDC Demo" . But when I search in the BDC Demo site it gives nothing.
    So I checked in the crawl logs and identified that it shows " 1 " under error. to further drill down the issue , I went to click on "1" and see the error message : Error while crawling LOB contents SharePoint 2013 .
    I have created an external DB named BCSDemo_DB for which I have granted my search Service account read& write permission.
    I have added the same account under administrators for both secure store and BCS service applications. 
    I have done index reset , done a full crawl but the error still occurs.
    Can someone please advise if I am missing something.
    Regards

    Hi Aravinda,
    According to your description, my understanding is that you got an error when you crawled SQL database table in SharePoint 2013.
    This error is caused by the fact that the default content access account does not have any rights to access the metadata store in the Business Data Connectivity Service Application.
    Or it is caused by the default content access account has no rights on the SQL database.
    For fixing it, you need to grant the default content access account permission on metadata store in the Business Data Connectivity Service Application and the SQL database. You can refer to the link below:
    http://www.sharepointinspiration.com/Lists/Posts/Post.aspx?ID=5
    After that, do a full crawl for the content source.
    Best Regards,
    Wendy
    Wendy Li
    TechNet Community Support

  • Error while saving record "john doe":     Error: -14140

    when changing a users preferences i try and save but it comes up with this error
    Error while saving record "john doe": Error: -14140
    and wont allow me to save
    any ideas?
    Many Thanks

    This thread might help you:
    http://www.afp548.com/forum/viewtopic.php?showtopic=16200
    This document is supposed to be very good as well:
    http://www.afp548.com/filemgmt_data/files/AD-OD-2.1.pdf

  • Anonymous Logon Error while using SSRS from SharePoint 2013

    I have SQL Reporting Services 2014 for SharePoint installed in SQL Server Box (SQL01) and SharePoint 2013 in a separate box (SPDEV01)
    in SPDEV01 i have installed Add-in for SSRS.
    when i generate a report using report builder i get an error saying Anonymous logon
    initially i got an error (rsClaimsToWindowsTokenLoginTypeError) for windows
    login and i followed the steps from below links
    http://msdn.microsoft.com/en-us/library/hh231678.aspx
    http://blogs.msdn.com/b/psssql/archive/2014/04/28/sharepoint-adventures-using-claims-with-reporting-services.aspx
    i am not able to complete all the steps mentioned in the above links as i have confusion in which box what has to be done and few are not applicable to the environment i guess
    Claims to Windows Token Service is also running
    after successfully completing few steps from the above links i am able to fix rsClaimsToWindowsTokenLoginTypeError but now
    i am getting anonymous logon error
    Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.
    Cannot create a connection to data source 'DataSource1'. (rsErrorOpeningConnection)
    An error has occurred during report processing. (rsProcessingAborted)
    the other thing i need to mention is i am using my account as service account, setup account and also as a farm admin, will that
    be an issue?
    i have to use my account as these are development boxes.
    need your inputs to fix this issue

    Hi ,
    Thank you for your question.
    I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated.
    Thank you for your understanding and support.
    Regards,
    Vicky Liu
    If you have any feedback on our support, please click
    here.
    Vicky Liu
    TechNet Community Support

  • Error while saving list workflow in sharepoint designer 2013

    Hi,
       I am trying to create custom workflow using sharepoint workflow 2013 at client side.While i am saving this,it thowas error-"Server side activities have been updated.you need to restart  sharepoint designer to use the updated version
    of activites"
    I have installed 32-bit sharepoint designer 2013 in my system and i have no access to server.
    I have also followed the solution  and deleted the contents in the below location.
    <user profile>\appdata\roaming\microsoft\SharePoint Designer\ProxyAssemblyCache
    <user profile>\appdata\local\microsoft\websitecache\<sitename>
    Please help to solve the error.
    Thank you

    You need to install updated version of SharePoint designer.
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/f255f4b4-1828-4ccb-983a-5efbf0e020ae/sharepoint-designer-2013-server-side-activties-have-been-updated-prompt?forum=sharepointcustomization
    Try below:
    http://stackoverflow.com/questions/19652391/error-while-saving-a-workflow-via-sharepoint-designer-server-side-activities-ha

  • Error while saving Employee Billrates through OAF page

    Dear All,
    I am facing the below mentioned error while saving Employee Bill rates for any project through OAF interface. I have tried saving the same through FORMS interface and its getting saved. The Unique constraint on the error log is on the table PA_EMP_BILL_RATE_OVERRIDES and the column is EMP_BILL_RATE_OVERRIDE_ID and we have a sequence for generating Unique id. The sequence used is PA_EMP_BILL_RATE_OVERRIDES_S.
    Please note that the error only fires on insertion of new record in the table PA_EMP_BILL_RATE_OVERRIDES, on updation error doesn't fire.
    The Constraint definition on the table is :
    create unique index PA.PA_EMP_BILL_RATE_OVERRIDES_U2 on PA.PA_EMP_BILL_RATE_OVERRIDES (EMP_BILL_RATE_OVERRIDE_ID)
    ERROR : java.sql.SQLException: ORA-00001: unique constraint (PA.PA_EMP_BILL_RATE_OVERRIDES_U2) violated

    Dear All,
    I am facing the below mentioned error while saving Employee Bill rates for any project through OAF interface. I have tried saving the same through FORMS interface and its getting saved. The Unique constraint on the error log is on the table PA_EMP_BILL_RATE_OVERRIDES and the column is EMP_BILL_RATE_OVERRIDE_ID and we have a sequence for generating Unique id. The sequence used is PA_EMP_BILL_RATE_OVERRIDES_S.
    Please note that the error only fires on insertion of new record in the table PA_EMP_BILL_RATE_OVERRIDES, on updation error doesn't fire.
    The Constraint definition on the table is :
    create unique index PA.PA_EMP_BILL_RATE_OVERRIDES_U2 on PA.PA_EMP_BILL_RATE_OVERRIDES (EMP_BILL_RATE_OVERRIDE_ID)
    ERROR : java.sql.SQLException: ORA-00001: unique constraint (PA.PA_EMP_BILL_RATE_OVERRIDES_U2) violated

  • Error While saving a iBot

    Hi All ,
    I am getting the below error while saving a iBot.
    Oracle BI Scheduler Error: [nQSError: 16001] ODBC error state: S1C00 code: 106 message: [Microsoft][ODBC Excel Driver]Optional feature not implemented . at stage of execute transaction command with data source: Procurement_Demo
    I am using xls as a datasource to create Repository. I have created scheduler tables for iBot in the same datasource.
    Can i not use XLS as a datasource for iBot?
    If i can use , what is the solution of this problem.
    Thanks in advance.
    -- Ashish

    Hi Vivek,
    Please close your SharePoint Designer application, clear/delete the cached files and folders under the following directories from your server installed SharePoint Designer, then check results again.
    <user profile>\appdata\roaming\microsoft\SharePoint Designer\ProxyAssemblyCache
    <user profile>\appdata\local\microsoft\websitecache\<sitename>
    http://www.andreasthumfart.com/2013/08/sharepoint-designer-2013-server-side-activities-have-been-updated/
    Thanks
    We are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Error while saving any workflow in database

    hi
    i had created a simple workflow and i was trying to save in database, but i faced following problem while saving...
    plz help for this
    1700: Could not connect with username/password 'system/[email protected]' ('ORA-12154: TNS:could not resolve the connect identifier specified
    -----------------------------------------------------------------------------------------------------------------------

    You need to install updated version of SharePoint designer.
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/f255f4b4-1828-4ccb-983a-5efbf0e020ae/sharepoint-designer-2013-server-side-activties-have-been-updated-prompt?forum=sharepointcustomization
    Try below:
    http://stackoverflow.com/questions/19652391/error-while-saving-a-workflow-via-sharepoint-designer-server-side-activities-ha

  • Error while executing script for sharepoint online (office 365) - the remote server returned an error: (503) server unavailable

    error while executing script for sharepoint online (office 365) - the remote server returned an error: (503) server unavailable.
    I am creating many site collections reading records from sharepoint list using powershell in sharepoint online tenant (office 365).
    Few site collections are created and then getting above error so this error record will be skipped then few succeeding record processed then again getting error.
    pattern is like:
    success
    success
    success
    success
    Error
    success
    success
    success
    success
    success
    success
    error
    success

    Hi,
    As it is an online environment, to troubleshoot this issue in an easier way, I suggest you contact Office 365 Support to see if there is any useful information in
    the log files in the server side:
    https://support.office.com/en-us/article/Contact-Office-365-for-business-support-32a17ca7-6fa0-4870-8a8d-e25ba4ccfd4b?ui=en-US&rs=en-US&ad=US
    Best regards
    Patrick Liang
    TechNet Community Support

  • Error while Saving the report

    Hi,
    i have created some reports which are working fine,
    but now i am facing some errors while saving the files.
    Also the reports does show only one record while there are many records in the database.
    The error messages are as follows:
    REP-1051; Unable to save document to file ' F:\Database\Reports\report1.rdf '.
    REP-1070: Error while opening or saving a document.
    Please help me to find out the exact problem.
    Also tell me how can i show all the pages of Database records in a report( while one record on each page)

    As for the error while saving, you have only one possible thing to try. It it doesn't work, you're sunk.
    Assuming the report was not being newly created, i.e. that it was opened from a file on your system, then rename that file to something else (Report_001_OLD.rdf, for example). Then try to save it - Reports will think it is a new file to be saved rather than an existing file to be updated.
    Again, if that doesn't work, and if you do not have the auto-save option turned on, then you're sunk. You will have just lost all of the work you've put into that report.
    As you'll discover, Reports is not the most robust application ever written.

  • Error while saving the Sales Order

    Hi experts,
        i am getting a runtime error while saving a sales order stating: SAPSQL_EMPTY_TABNAME. It says the field T681-KOTAB could be empty. I would give in more inputs. Someone plz help.
    Thanks.

    I would expect that KOTN521 would be a Database table defined in the ABAP Dictionary that relates to the condition implemented in 521 for the usage specified in that record.
    You should be able to go into the info system, SE84, and search under ABAP Dictionary / Database Tables to see what KOTN521 is.
    Also, since the only Keys to T681 are KVEWE and KOTABNR, and there are two KOTABNR entries with a value of 521, then there must be two different usages (KVEWE) associated with that table.
    If you see what they are, you can check to see what the usages represent.   Based on a lookup, it appears that a usage of N is for Free Goods, A is for Pricing etc.   In our system, we only have A entries.
    What are the usages for the 521 entries?  Do they relate to Free Goods/Pricing???
    Does the table KOTN521 exist in the ABAP Dictionary?
    Answering these questions may get you closer to the answer.
    Can you compare the values in these entries to what you have in different SIDs?
    Is this problem happening in Production, or is it still in a development or Quality Assurance client?
    If it is still in development or Q, then it may be that a recent customization change was made.
    Compare the entries across your systems, if possible.
    Good luck
    Brian

  • Sorry, we couldn't open...Error opening office documents from SharePoint 2013 in the desktop applications

    Sorry, we couldn't open...Error opening office documents from SharePoint 2013 in the desktop applications        
    One of our Managers encounters the error 'A problem occurred while accessing the Office document cache.  Do you want to repair this problem?'
    Then When he says yes it give a warning that the cache will be backed up and replaced
    Then it says 'A new office document Cache has been created...'
    Then it loads this cache with an error
    Then After all that the next time he tries to open the document it says  is encountered "Sorry, we couldn't open 'URL."
    We have Reinstalled office 2013 on the users PC repaired the cache numerous times
    Followed -  http://office.microsoft.com/en-gb/word-help/manually-rename-the-office-document-cache-HA101848838.aspx
    Updated Lync to 2013 leaving Access as the only office 2010 application (required for legacy systems access)
    Repair installed office 2010 and office 2013 again
    The SharePoint site has been added to the trusted sites list and the set up assistant run from office 365
    And the issue remains the Same all other users including some who also have Access 2010 for legacy systems access have no Issues OS is windows 7 32 Bit browser is IE 9
    Office 365 said
    Reply by Rachel Zhang MSFT Support
    Hi Alex,
    From your description, I notice that the issue is related to Office client. We would like to help you, but I’m sorry that our forum does not focus on this scenario and has limited resources regarding it. However, we have a dedicated support forum where
    the support engineers will help you with the issues about Office client:
    Microsoft Office Community:
    http://answers.microsoft.com/en-us/office/forum/office_2013_release?tm=1365567547805
    Feel free to sign in to the Office community and click Participate->Ask a Question to post the question with the relevant information.
    Microsoft Office Community:  
    Feel free to sign in to the Office community and click to post the question with the relevant information.
    Office team said
    Hello Alex,
    Thank you for posting your query in Microsoft Office Community.

    Check if other excel works fine
    Do you have any script\macro in excel file
    Check if all application pool on all servers are running
    both office and IE should be same build (64 or 32 bit)
    what is the error message in ULS log and Event viewer
    If this helped you resolve your issue, please mark it Answered

  • PSC 2510 - Wireless setup - "Error while saving the settings to the device."

    While trying to setup my PSC 2510 to be wireless I get an error message "Error while saving the settings to the device.". This comes after selecting connecting Through Network, selecting printer device, selecting WEP, entering key, and clicking next.
    PSC 2510
    Windows Vista
    Using latest sfotware from HP to install
    Thanks
    Dennis
    This question was solved.
    View Solution.

    ISSUE RESOLVED .. based on responce from PrintDoc to penn (refrence topic "C4385 Printer - Netgear DGN2000 - wireless setup".
    PrintDoc responce helped me find my problem (to reset network settings on the printer to factory) even though diffrent printer.
    Thanks

  • Error while saving data form in planning

    Hi,
    We are getting the below error while saving the data form in planning
    "There was an error during the save process"
    i believe our form is not exceeds 255 columns we were able to access the same form till yesterday
    can any one please help me on this

    One reason could be that the blocks that you are trying to save are locked either through excel-addin or someone else might be updating the same combinations. I have encountered such issues earlier and got the same error. Check if there are any locks in essbase while you are saving the planning data.

Maybe you are looking for

  • Clean Install WIn 7 from Lenovo_Recovery

    Hi! I have a Lenovo T420 with Windows 7 64 (purchased 2011). Since Hard drive is very slow and full of junk, I would like to re-install windows on my C partition. My question is (and I would like to see any of your recommended workflows please): 1) S

  • ATI Driver [solved]

    Hi, I just installed the most recent version of Arch Linux on a Dell Latitude laptop (ATI Rage Mobility M3) and I am trying to get x windows running. I ran xorgconfig, and now when I try to use 'startx' I get the following (==) Using config file: "/e

  • How can I determine the device number from the task ID

    I'm using 'Port Config' to initialize my DIO port for a NI-DAQ 6052E. Port Config returns a task id and it would be very useful if I could determine what device number I have based on the task id.

  • How long does it take to set up iphone 6 from icloud restore

    I am trying to set up my new iPhone 6 plus from the icloud back up I made on my old iPhone 5c.  Its been several hours, everything appears to be on the phone but when I go to settings to try to update the ios, it states I cannot perform the update un

  • Issuing a Break Command

    Hello all- I'm trying to get some code running in MATLAB on my MacBook Pro, and I made the mistake of writing an infinite loop. Normally, I'd just hit CtrlBreakBreak in order to terminate the running program. There's no Break key on the Apple keyboar