OData update

Hi,
I'm trying to update my table using the oData Update. Below is the code
press: function(){                                                                                                                         // BUTTON PRESS
    var currentContext = this.getBindingContext();
             var oCurrentModel = currentContext.getModel();
             selectedProductID = oCurrentModel.getProperty("ID", currentContext);
             if(this.getText()==='Edit'){
              //oTable.setEditable(true);
              this.setText('Save');
              oCurrentModel.setProperty('editable',true,currentContext);   
             else{                                                                                                                                       //UPDATE OCCURS HERE
              this.setText('Edit');
              oCurrentModel.setProperty('editable',false,currentContext);
              var oParams = {};
              oParams.fnSuccess = function(){ alert("Update successful");};
              oParams.fnError = function(){alert("Update failed");};
              oParams.bMerge = true;
              oUpdate = oCurrentModel.getData();
              oModel.update('/CarbonData('+selectedProductID+')', oUpdate, oParams);
Below is the screenshot I get in FireBug
The code works if I assign values to individual variables. For Ex:
function updateDetails() {
    var oProduct = oModel.getData('/CarbonData('+selectedProductID+')');
    oProduct.ID = sap.ui.getCore().byId("Id_m").getValue(),
  oProduct.Loc_ID = sap.ui.getCore().byId("loc_id_m").getValue(),
  oProduct.Label = sap.ui.getCore().byId("Label_m").getValue(),
  oProduct.Region = sap.ui.getCore().byId("Region_m").getValue();
  oProduct.Country = sap.ui.getCore().byId("Country_m").getValue();
  oProduct.City = sap.ui.getCore().byId("City_m").getValue();
  oProduct.Emitter = sap.ui.getCore().byId("Emitter_m").getValue();
  oProduct.Quarter = sap.ui.getCore().byId("Quarter_m").getValue();
  oProduct.Carbon_Footprint = sap.ui.getCore().byId("Carbon_Footprint_m").getValue();
  oModel.update('/CarbonData('+selectedProductID+')', oProduct, null, function(data) {
  sap.ui.commons.MessageBox.show("Product " + oProduct.ID + " Updated!",
  sap.ui.commons.MessageBox.Icon.SUCCESS, "Product Saved",
  sap.ui.commons.MessageBox.Action.OK);
  }, function(err) {
  //Error Callback:
  alert("Error occurred " + err.message);
But I can't keep it this way as I need to make it more dynamic.
Can anyone help me out?

Hi John,
The press is an event handler for a button. It works fine when I copy the values to separate fields and then push them into the table (oData update).
For Ex: The below code works
function updateDetails() { 
    var oProduct = oModel.getData('/CarbonData('+selectedProductID+')'); 
    oProduct.ID = sap.ui.getCore().byId("Id_m").getValue(),  
  oProduct.Loc_ID = sap.ui.getCore().byId("loc_id_m").getValue(), 
  oProduct.Label = sap.ui.getCore().byId("Label_m").getValue(), 
  oProduct.Region = sap.ui.getCore().byId("Region_m").getValue(); 
  oProduct.Country = sap.ui.getCore().byId("Country_m").getValue(); 
  oProduct.City = sap.ui.getCore().byId("City_m").getValue(); 
  oProduct.Emitter = sap.ui.getCore().byId("Emitter_m").getValue(); 
  oProduct.Quarter = sap.ui.getCore().byId("Quarter_m").getValue(); 
  oProduct.Carbon_Footprint = sap.ui.getCore().byId("Carbon_Footprint_m").getValue(); 
  oModel.update('/CarbonData('+selectedProductID+')', oProduct, null, function(data) { 
  sap.ui.commons.MessageBox.show("Product " + oProduct.ID + " Updated!", 
  sap.ui.commons.MessageBox.Icon.SUCCESS, "Product Saved", 
  sap.ui.commons.MessageBox.Action.OK); 
  }, function(err) { 
  //Error Callback: 
  alert("Error occurred " + err.message); 
However, it fails when I try an update directly using the object and I get an error saying;
Request contains properties that do not exist in entity 'CarbonDataType'
Do you know why it returns "&#x0027" ??

Similar Messages

  • Problem in implementing ODATA update using SAP UI5

    Hi,
      I am trying to develop an hwc mobile app [hwc] using sapui5 and phonegap. I am trying to perform odata crud operations in the app.
    In the netweaver side, currently we have disabled the setting for X-CSRF token so that CUD operations are possible even without CSRF token. I am using datajs library for consumption of the odata services in my app. My read operation is successful and i am able to display the data in my app. But I am facing problems in the update operation.
    In order to ensure that serverside is perfect, I used the WFetch tool to perform the update operation and verified that data got updated successfully in SAP backend { i got 204 response from server ]. In the wfetch tool, the headers and body section was like this
    x-requested-with: XMLHttpRequest\r\n
    \r\n
    <?xml version="1.0" encoding="utf-8" standalone="yes"?>\r\n
      <entry xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">\r\n
          <content type="application/xml">\r\n
            <m:properties>\r\n
              <d:value>0203_IN120</d:value> \r\n
              <d:scheme_id>Z_BANK_RFC_GANESH</d:scheme_id> \r\n
              <d:scheme_agency_id>LOCAL</d:scheme_agency_id> \r\n
              <d:post_bank /> \r\n
              <d:bank_branch>BANASWADI</d:bank_branch> \r\n
              <d:street>123 MARUTHI SEVA NAGAR.</d:street> \r\n
              <d:city>BANGALORE</d:city> \r\n
              <d:swift_code/>\r\n
              <d:region>KA</d:region> \r\n
              <d:bank_name>HSBC</d:bank_name> \r\n
              <d:pobk_curac /> \r\n
              <d:bank_group /> \r\n
              <d:addr_no /> \r\n
            </m:properties>\r\n
          </content>\r\n
    </entry>\r\n
    The response i got was like this
    WWWConnect::Connect("XXXXX.XXXX.com","8000")\nIP = "10.6.13.146:8000"\nsource port: 50054\r\n
    REQUEST: **************\nPUT /sap/opu/sdata/sap/ZBANKRFCGANESH/z_bank_rfc_ganeshCollection(value='0203_IN120',scheme_id='Z_BANK_RFC_GANESH',scheme_agency_id='LOCAL')/?$format=xml HTTP/1.1\r\n
    x-requested-with: XMLHttpRequest\r\n
    Host: i3lbwvids.itcinfotech.com\r\n
    Accept: */*\r\n
    Content-Length:884\r\n
    Authorization: Basic Z2FuZXNoOmxvZ2luQDEyMzQ=\r\n
    \r\n
    <?xml version="1.0" encoding="utf-8" standalone="yes"?>\r\n
      <entry xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">\r\n
          <content type="application/xml">\r\n
            <m:properties>\r\n
              <d:value>0203_IN120</d:value> \r\n
              <d:scheme_id>Z_BANK_RFC_GANESH</d:scheme_id> \r\n
              <d:scheme_agency_id>LOCAL</d:scheme_agency_id> \r\n
              <d:post_bank /> \r\n
              <d:bank_branch>BANASWADI</d:bank_branch> \r\n
              <d:street>123 MARUTHI SEVA NAGAR.</d:street> \r\n
              <d:city>BANGALORE</d:city> \r\n
              <d:swift_code/>\r\n
              <d:region>KA</d:region> \r\n
              <d:bank_name>HSBC</d:bank_name> \r\n
              <d:pobk_curac /> \r\n
              <d:bank_group /> \r\n
              <d:addr_no /> \r\n
            </m:properties>\r\n
          </content>\r\n
    </entry>\r\n
    RESPONSE: **************\nHTTP/1.1 204 No Content\r\n
    set-cookie: MYSAPSSO2=AjQxMDMBABhHAEEATgBFAFMASAAgACAAIAAgACAAIAACAAY4ADAAMAADABBJAEQAUwAgACAAIAAgACAABAAYMgAwADEANAAwADEAMgA5ADAANwAyADUABQAEAAAACAYAAlgACQACRQD%2fAPowgfcGCSqGSIb3DQEHAqCB6TCB5gIBATELMAkGBSsOAwIaBQAwCwYJKoZIhvcNAQcBMYHGMIHDAgEBMBkwDjEMMAoGA1UEAxMDSURTAgcgEQQGCClRMAkGBSsOAwIaBQCgXTAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0xNDAxMjkwNzI1MzlaMCMGCSqGSIb3DQEJBDEWBBRF%2fqnZ6znAGOYDuA1QJxZ7kOYTfDAJBgcqhkjOOAQDBC4wLAIUNk9rqGV16RPsLrLsHfHtNPc%21Q44CFBRiJ4BhRrmxUVH77EYIGSSd8WPb; path=/; domain=.itcinfotech.com\r\n
    content-length: 0\r\n
    dataserviceversion: 2.0\r\n
    x-sap-odata-extension-version: 0.9;gp=0.8\r\n
    server: SAP NetWeaver Application Server / ABAP 702\r\n
    \r\n
    Now i tried to do that using sapui5 code.
    OData.request(
                       requestUri: "http://XXXXX.XXXXX.com:8000/sap/opu/sdata/sap/ZBANKRFCGANESH/z_bank_rfc_ganeshCollection(value='0203_IN120',scheme_id='Z_BANK_RFC_GANESH',scheme_agency_id='LOCAL')/?$format=xml",
                       method: "PUT",
                       headers: { "X-Requested-With": "XMLHttpRequest", "sap-user" : "ganesh", "sap-password" : "login@1234",  "Content-Type": "application/atom+xml" },
                       data: {
                               "value" : "0203_IN120",
                               "scheme_id" : "Z_BANK_RFC_GANESH",
                               "scheme_agency_id" : "LOCAL",
                               "post_bank" : "",
                               "bank_branch" : "Park Street",
                               "street" : "Russel Street",
                               "city" : "KOLKATA",
                               "swift_code" : "",
                               "region" : "WB",
                               "bank_name" : "HSBC",
                               "pobk_curac" : "",
                               "bank_group" : "",
                               "addr_no" : ""
                     function (data, response){ 
                       // var header_xcsrf_token = response.headers['x-csrf-token']; 
                      //  alert(header_xcsrf_token);
                        //  alert("hello");
                          //alert(data);
                         alert(JSON.stringify(response, null, 4));
                     function (err) {
                        alert(err.message);
      I found the I am always getting a 200 OK in the respose and not 204 [ when i displayed the response using the alert message]. As expected data is also not getting updated.
    Kindly guide me where i am going wrong in the code. Please help me out.
    thanks and regards,
    krishna.

    Hi Krishna
    I will try and help.
    The first thing i notice is you are using OData.request, this is not part of SAPUI5, OData is a global introduced by the datajs thirdparty plugin, I would recommend not using it directly, instead use the ODataModel API start by reading the Class sap.ui.model.odata.ODataModel and ODataModel.  There are a lot of good of reasons for using the ODataModel, like databinding, event handling, it doesn't smell like a leak, besides the SAPUI5 ODataModel is a lot easier to use.
    try something like this
    var url = 'http://XXXXX.XXXXX.com:8000/sap/opu/sdata/sap/ZBANKRFCGANESH';
    var bJSON = true; //use JSON
    var sUser = 'ganesh';
    var sPassword = 'login@1234';
    // create a model for OData service call
    var oModel = new sap.ui.model.odata.ODataModel(url, true, sUser, sPassword);
    sap.ui.getCore().setModel(oModel);
    var path = '/z_bank_rfc_ganeshCollection(value='0203_IN120',scheme_id='Z_BANK_RFC_GANESH',scheme_agency_id='LOCAL')';
    // create the data
    var data =  {
        "value": "0203_IN120",
        "scheme_id": "Z_BANK_RFC_GANESH",
        "scheme_agency_id": "LOCAL",
        "post_bank": "",
        "bank_branch": "Park Street",
        "street": "Russel Street",
        "city": "KOLKATA",
        "swift_code": "",
        "region": "WB",
        "bank_name": "HSBC",
        "pobk_curac": "",
        "bank_group": "",
        "addr_no": ""
    // get a CSRF token if needed
    oModel.refreshSecurityToken();
    // add own callback code
    var oParams, fnSuccess, fnError, bUseMERGE;
    //PUT data back to server
    oModel.update(path, data, oParams, fnSuccess, fnError, bUseMERGE);
    Let us know how you get on
    hth
    jsp
    Message was edited by: John Patterson
    I really dislike the SCN editor, especially the way it re formats code so it cannot be read while writing

  • SAPUI5 OData update error CSRF Token Failed

    I'm getting an error when I do an update on my odata.  Below is my code snippet:
    var sServiceUrl = "serviceURL";
            // Contact Model
            var updateQntModel = new sap.ui.model.odata.ODataModel(sServiceUrl, false, "usrname", "password");
            var oEntry = {};
            oEntry.fieldval = "14";
            var oParams = {};
            oParams.fnSuccess = function(){ alert("Update successful");};
            oParams.fnError = function(){alert("Update failed");};
            updateQntModel.update("/sPath(field='2222',field2='333',field3='2222')", oEntry, oParams);
    The error I am getting: CSRF token validation failed
    Anyone have an idea what's causing this?
    Tags edited by: Michael Appleby

    Hi Jay,
    Use the below code for refreshing the security token.
    updateQntModel.refreshSecurityToken(
                                                                         updateQntModel.update(
                                                                                                                      "/sPath(field='2222',field2='333',field3='2222')",
                                                                                                                       oEntry ,
                                                                                                                       oParams ,
                                                                                                                       function(){alert ("Update success");},
                                                                                                                       function(){alert ("Update  error");}
                                                                          function(){alert ("Security Token error");}
    Try the above code it will work.
    Cheers ,
    Aisurya

  • How to perform Update operation in Ios using Odata Services

    Hello,
          I want to do PUT(update) operation on odataservice... I am using followin code to get the proper Entry property to update
    SDMODataEntry * entry1=((SDMODataEntry *)[ArraySelectedCell objectAtIndex:0]);
        SDMODataPropertyValueObject* obj = ((SDMODataPropertyValueObject*)[entry1getPropertyValueByPath:@"rm_comment"]);
    But i am getting following error
    __NSDictionaryM getPropertyValueByPath:]: unrecognized selector sent to instance 0x10166620
    Please help...
    Regards,
    Ravindra

    Ravindra Dolas
    Can you please look at this thread SMP 3.0 - OData CRUD Help
    I hope you will get some inputs.
    Rgrds,
    Jitendra

  • SetProperty on OData model - update multiple entities before submitChanges on batch

    I have a list in my application:
    This data is bound to an OData model.
    If I perfrom call I can retrieve the data fod the "fridge" item:I can retieve the OData for item 456.
       this.getView().getModel().getProperty("/Items(BookingId='123',ItemId='Fridge')")
    Therefore I can set the couonter like this:
    this.getView().getModel().setProperty("/Items(BookingId='123',ItemId='Fridge')"+"/ItemCount", 6)
    But once I have done this "SetProperty" call I am now unable to set any other properties on any of the other items!
    What I want is to be able to change as many items as I like and then on SAVE do a batch OData PUT to update the values in the backend.
    If I'm honest what I really want is to be able to do a DEEP INSERT into my OData provider, which contains a Booking, with nested sub-items..
         Booking 1:m Items
    How can I do this whilst also using the "setProperty" method?
    setProperty is great in regards to if I make changes and then hit "CANCEL" I can call "resetChanges" to undo any changes.. but at the moment I can only change ONE of these counters before commiting my changes...
    Surely this must be a common requirement, to make many changes in the front-end to multiple entities and then POST/PUT them all at once?
    Thank you for any advice

    A seemingly bug in SAPUI5 ODataModel setProperty() funtion

  • Query a Odata feed on UI update in Excel

    I have an Odata service which has a function named Foo() which returns me data after doing operations and also have another function foo2() which returns a different set of data.
    now i have a drop down list in excel and on selecting value one it should query the odata feed to return the dataset from foo() and on selecting the second it should return the dataset from foo2()
    How do i do this. any help would be much appreciated

    Hi,
    I think you will need to use VBA code to achieve it. As I'm not quite know how to call the Odata service function within Excel, you need to modify the VBA code.
    Anyway, if the drop down list  was created by using data validation, and located in Range A1, then you can try the VBA code below:
    Private Sub worksheet_change(ByVal target As Range)
    If target.Address = "$A$1" Then
    If Range("A1") = 1 Then
    Foo() 'call function Foo (need change)
    Else
    Foo2() 'call function Foo2
    End If
    End If
    End Sub
    Wind Zhang
    TechNet Community Support

  • Error while running an Odata service in Advanced Rest Client

    Hi Experts,
    We have created one simple OData model (using Integration gateway) with datasource as SOAP web service. We are able to test the SOAP Web service in STORM tool and getting desired response. But when we run the converted OData URL in Advanced REST Client we are getting the following exceptions/errors.
    Could not send message
    Also, while looking at SMP3 server log, we came across below error logs:
    +0530#ERROR#com.sap.gateway.core.ip.odata.ODataErrorCallbackImpl##anonymous#http-bio-8080-exec-1###handleError(): failed to serve request for URI http://<ip>:8080/gateway/odata/sap/REL2;v=1/GetUserDets(Applid='****',Applpwd='****',Fund='***',Userid='****.***@gmail.com',Password='***@1234'), message = Could not instantiate data provider based on class null |
    +0530#ERROR#com.sap.gateway.core.ip.runtime.PathInfoExtractor##anonymous#http-bio-8080-exec-1###null java.lang.IllegalArgumentException: null
    Any help?
    Regards,
    JK

    Jitendra Kansal
    After updating my DB and do the ODATA service after completion of that hit the server in chrome it shows error like
    <error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
    <code/> 
    <message xml:lang="en"> 
    Could not instantiate data provider based on class null
    </message>
    </error>
    expet that service i did another one it is working fine using the same server with out set the proxy

  • Error while updating spatial table

    Hi,
    When i try to update a spatial table with the following syntax i get the below error,
    UPDATE tab1 SET MP = 1, AT = 3,
    RDATE = TO_DATE('30:04:2001:16:04:08', 'DD:MM:YYYY:HH24:MI:SS'),
    ODATE = TO_DATE('30:12:1899:00:00:00', 'DD:MM:YYYY:HH24:MI:SS'),
    REP = 1
    WHERE ID = 7
    ERROR at line 1:
    ORA-29877: failed in the execution of the ODCIINDEXUPDATE routine
    ORA-00600: internal error code, arguments: [kcbgtcr_1], [], [], [], [], [],
    Any idea why is this happening??
    Thanks
    Shiva
    null

    Hi Dan,
    we are using oracle 8.1.6.3 on Solaris 8.
    Table description is as follows.
    ID NOT NULL NUMBER(10)
    ROUTE_NUMBER NOT NULL VARCHAR2(255)
    MP NUMBER(8,3)
    GEOM MDSYS.SDO_GEOMETRY
    AT NUMBER(10)
    RDATE DATE
    CDATE DATE
    ODATE DATE
    REPORT NUMBER(10)
    CLEAR NUMBER(10)
    OFFER NUMBER(10)
    X NUMBER(8,6)
    Y NUMBER(8,6)
    This table has a valid entry in the user_sdo_geom_metadata table. And the spatial index is valid.
    Thanks
    Shiva

  • Odata Connection Refresh Error while using excel web app - Project Online 2013

    Hello All,
    I am trying to work with odata reporting on project online 2013. I am not using MS Excel client, I open any of the available default report in excel online. when i try to refresh data connection from data tab. it's giving me an error
    as show below 
    screen..
    I have already enabled "PWA for excel web app refresh" feature.  
    Following the blog instructions and microsoft support, i have tried to grant permission to
    AppId=  00000009-0000-0000-c000-000000000000
    And In the Permission Request XML field, copy and paste the following XML: 
    <AppPermissionRequests>
        <AppPermissionRequest Scope = "http://sharepoint/projectserver/reporting"
    Right="Read">
        </AppPermissionRequest>
        <AppPermissionRequest Scope = "http://sharepoint/content/tenant"
    Right="FullControl">
        </AppPermissionRequest>
    </AppPermissionRequests>
    Now, According to the microsoft, it should show Microsoft.Azure.Azureservices as Title but as per below screen shot it shows Power BI Reporting and Analytics..
    title.<o:p></o:p>
    However, i click on ok button and check that the permission has been granted. i can see Microsoft Power BI reporting and analytics in the app permissions.
    I again go to my BI reporting, open my report in excel online and refresh the data connection and nothing changed. It's giving me the same error.
    I hope that i am able to narrate my problem. Please tell me, What i am missing here...
    sandeep

    Ok, why did manually add / update the permission XML? Do you get this error for new Excel based reports? Test creating a new one, example here:
    http://pwmather.wordpress.com/2013/08/01/projectserver-projectonline-highlight-report-example-ps2013-sp2013-excel-bi-office/
    http://pwmather.wordpress.com/2013/09/16/projectserver-projectonline-example-report-ps2013-sp2013-office365-bi-excel-powerpivot/
    http://pwmather.wordpress.com/2014/07/17/getting-started-with-projectonline-part-9-ps2013-office365-project-ppm-sharepointonline-pm-sp2013/
    Paul
    Paul Mather | Twitter |
    http://pwmather.wordpress.com | CPS

  • Getting Error while accessing the data using odata service

    Hi All,
    Iam new to SAP FIORI. 
    Iam getting the below error while accessing the data using odata service.
    "Failed to load resource: the server responded with a status of 404 (Not found)"
    "No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin "
    i have tried all the solutions like changing the url pattern "proxy/htttp".
    and disabled - security in chrome (Chrome is Updated version).
    i tried with IE still got the same problem.
    And installed all the required software in eclipse
    While installing GWPA plugin i got the following error.
    let me know if any one have idea.
    Thanks in advance.

    > Do you want to add and/or update the data in the already existing tables or do you want to replace the content completely?
    >
    > so in that way :
    > bot the options are fine what ever take less time.
    Sorry mate, but YOU have to know what you want here.
    I gave you an easy to follow set of steps.
    As you don't seam to mind the outcome, just might just use them...
    > I wanted to know weathe i can use the  loadercli for thie export import or not? if yes then is there any new steps to do before i do the export import?
    We had this discussion before...
    >
    > For that the easiest option would be just to drop the tables of SAPR3 and run the import again.
    >
    > For ease of use you could also just do:
    > - logon as superdba
    > - drop user SAPR3
    > - create user SAPR3 password SOMEPW not exclusive dba
    >
    > After these steps you can easily pump the data into the database again.
    >
    > So here in th above given steps , i am creating a new SAPR3 user and why it is not exclusive dba ?
    >  i already have that user SAPR3 can i use the same.
    Yes, you do have the SAPR3 user.
    But you don't seem to like to read documentation or learn about how the tools work or anything like that.
    Therefore I gave you s simple way to reach your goal.
    Of course it's possible to reuse the user.
    But then you would have to deal with already existing tables, already existing data etc.
    You don't seem to be able to do that. So, the easy steps might be better suited for your needs.
    regards,
    Lars

  • SSIS package with OData connection - can't connect

    I need to read some data from a SP list. I have the OData connection manager setup. When I test the connection to my sharepoint site, it says it's successful. I added in a data flow task and then an OData Source. In the OData Source editor, I select the
    Odata connection manager. I want to use a collection. However, it says "Unable to load collection for the connection Odata Source, reason: Cannot open this connection"
    Anybody know how to resolve this?

    Hi kayla,
    Just as you said, the current
    SharePoint List Adapter that extracting and loading SharePoint Data in SQL Server Integration Services supports x86/x64 systems using SQL 2005 / SQL 2008 / SQL 2008 R2/ SQL 2012. It doesn’t support SQL 2014. Maybe we need waiting the update.
    The
    OData Source component can be used to read data from SharePoint lists in SSIS 2014. Please download and install the 64 bit ODataSourceForSQLServer2014-amd64.msi or 32 bit ODataSourceForSQLServer2014-x86.msi from the
    Microsoft® SQL Server® 2014 Feature Pack.
    Reference:
    Tutorial: Using the OData Source
    Using the SSIS OData Source Connector to read data from SharePoint lists
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    If you have any feedback on our support, please click
    here.
    Katherine Xiong
    TechNet Community Support
    Hi Katherine,
    I did install that already. I added the OData source to my SSIS package. The odata connection manager successfully connects to the sharepoint site. However, when I use the data source in the Odata Source within the Data Flow, it gives me the "cannot
    open this connection" in the Collection list within the Odata source editor. I'm stumped as to why the connection manager has a successful test connection, but the collections don't pull up. Does the list need some special permissions? I'm able to access
    it directly on the sharepoint site and add items (the odata connection manager is running with my windows credentials)

  • Tree table is not reflecting the updated model data changes at the front end

    I have two tables ,
    1) Provider table(tree table)  2)member table
    I have implemented drag and drop functionality using jQuery UI on both tables.
    In my scenario when I drag a member from the member table and drop it on the Provider table and also when I delete an assigned member from the provider table I will update the data fetched from odata model and again I will call the method which binds the data to the provider table so that the table will reflect the changes.
    here is the code,
    on drop:
    $("#Provider tbody tr").droppable({
      drop: function(event){
           oController.AssignMember(oProviderId, oMemberId)
      }).disableSelection();
    Assign member function:   here am updating the model.
    AssignMember : function(oProviderId, oMemberId){
      var oModel = new sap.ui.model.odata.ODataModel("../../../services/provider.xsodata/", true);
      var oParameters = {};
      oParameters.PROVIDER_ID = oProviderId;
      oParameters.MEMBER_ID = oMemberId;
      oParameters.CREATED_ON = new Date();
      oModel.setHeaders({"content-type" : "application/json;charset=utf-8"});
      oModel.create( "/PROVIDERMEMBERS", oParameters, null, function() {
      var oController = sap.ui.controller("adsm.provider.member_assignment_view");
      oController.GetProviderData();
      },function(jqXHR) {
      var errorMessage = jqXHR.response.body;
      var jsondata = JSON.parse(errorMessage);
      sap.ui.commons.MessageBox.alert(jsondata.error.message.value);
    GetProviderData function: here i bind the data to the table
    GetProviderData: function(){
    var oModel = new sap.ui.model.odata.ODataModel("../../../services/provider.xsodata/", true);
    var Context = "/PROVIDERS?expand=ASSIGNEDMEMBERS&$select=NAME,ID,ASSIGNEDMEMBERS/NAME,ASSIGNEDMEMBERS/ID,ASSIGNEDMEMBERS/PROVIDER_ID";
      var oTable = sap.ui.getCore().byId("tblProviders");
      oModel.read(Context, null, null, true, onSuccess, onError);
      function onSuccess(oEventdata){
      var outputJson = {};
      var p = 0;
      var r = {};
      if (oEventdata) {
      r = oEventdata;
      try {
      if (oEventdata.d){
      r = oEventdata.d;
      } catch(e){
      //alert('oEventdata.d failed');
      try {
      if (oEventdata.d.results){
      r = oEventdata.d.results;
      } catch(e){
      //alert('oEventdata.d.results failed');
      try {
      if (oEventdata.results){
      r = oEventdata.results;
      } catch(e){
      //alert('oEventdata.results failed');
      $.each(r, function(i, j) {
      outputJson[p] = {};
      outputJson[p]["NAME"] = j.NAME;
      outputJson[p]["ID"] = j.ID;
      outputJson[p]["PROVIDER_ID"] = j.ID;
      outputJson[p]["DELETE"] = 0;
      var m = 0;
      if (j.ASSIGNEDMEMBERS.results.length > 0) {
      $.each(j.ASSIGNEDMEMBERS.results, function(a,b) {
      outputJson[p][m] = { NAME: b.NAME,
      ID : b.ID,
      PROVIDER_ID: b.PROVIDER_ID,
      DELETE: 1};
      m++;
      p++;
    var oModel = new sap.ui.model.json.JSONModel();
      oModel.setData(outputJson);
      oTable.setModel(oModel);
      function onError(oEvent){
      console.log("Error on Provider Members");
    oTable.bindRows({
      path:"/"
    Its working fine in chrome but in IE the model data gets updated but the table is not reflecting the changes at front end.Can anyone suggest me a possible solution to fix this?
    Please have a look at the attached screen shots.
    Best regards,
    Amala Suganya.

    Hi Amala,
    I think this will help you:
    Disabling Cache for CRUD/FI OData scenarios for a UI5 Application on Internet Explorer
    Kind regards,
    RW

  • No authorization on HANA cloud platform odata and UI5

    Hi there,
    I'm building a SAPUI5 app on the trial cloud. I have a local table in the xs application, which i present via odata. In my SAPUI5 app i have a list showing the content of this table.
    I currently have the whole app working, but with authorization, i want to be able to access the data without authorization. I have tried the following based on this thread SAP Hana Anonymous User? And HTTP POST method? | SAP HANA
    So i have the following in my .xsaccess file
    "anonymous_connection": "XXXXXXX.myxsapp::anonuser",
    "exposed" : true,
      "authentication": null
    i have a anonuser.sqlcc file which have the following content
      "description" : "Anon SQL connection"
    In the above thread it mentions i should update the table _SYS_XS"."SQL_CONNECTIONS either via SQL command or the xs admin tool. However i don't have the privilege to use the SQL command and i can't seem to gain access to the xs admin tool.
    Please any help is much appreciated.

    Hi Jakob,
    for security reasons the HANA systems offered by the free HANA Cloud Platform Trial are not granting access to administrative features such as the xs admin tool. Also, certain operations are not permitted. For operations that are permitted your find a documentation for procedures and views to work with: SAP HANA Cloud Platform Documentation. If you require features that are not available on the free trial I recommend to get a SAP HANA Cloud Platform Starter Edition that will come without feature limits: SAP HANA Cloud Platform, starter edition | Information Technology | Lines of Business | SAP HANA Marketplace
    Best,
    Thomas.

  • How to update the field of a Parent enity (field is not visibe on the Form) from a Child Entity in MSCRM 2013

    Hi All,
              I m new to CRM customization. I have requirement like this..
    I have 3 entities.. Entity1 , Entity 2 and Entity3.
    Entity1 is the parent of Entity2 and Entity3. Entity2 is the parent of Entity3 and child of Entity1 ..
    In Entity1 I have a field eg:product1 which acts as lookup for Entity2 field availableproducts.  Now in Entity2 I have a field the quantity of products which acts as lookup for Entity3 as given below.
    In Entity3: fields:;; products==Lookup of Products(Entity1)
                                  quantity == Lookup of Quantity (Entity2)
    Now from Entity3 I need to update the fields of Entity1 like I have field named Price which is not visible on the Entity3 Form  but when I access this field from javascript I m getting null exceptions since the field is not in the context of the Entity
    on which it is defined. How can I update the fields of the Parent Entity1 from child Entity3  and also update the quantity field on Entity2 which are not avialable on the Entity3 Form.
    Any help is appreciated
    Waiting for the reply..
    FayazSyed

    Hi,
    To do it in JS you need to use oData, as wrote above:
    to make this requests easer, i use a XrmSvcToolkit library (https://xrmsvctoolkit.codeplex.com/)
    Your code will be about this:
    /// <reference path="rtb_XrmSvcToolkit.js" />
    XrmSvcToolkit.retrieve({
    entityName: "Entity1",
    id: Xrm.Page.getAttribute("quantity").getValue()[0].id,
    select: ["my_FieldNeedToUpdate"], //Here are the name of your fields, which you want to select.
    expand: [""],
    async: false,
    successCallback: function (result) {
    FieldNeedToUpdate= result.my_FieldNeedToUpdate;
    errorCallback: function (error) {
    Error = error;
    FieldNeedToUpdate = FieldNeedToUpdate + 1; //Doing some work here
    var InputEntity =
    my_FieldNeedToUpdate: FieldNeedToUpdate //here are fields, witch you want to update
    XrmSvcToolkit.updateRecord({
    entityName: "Entity1",
    id: Xrm.Page.getAttribute("quantity").getValue()[0].id,
    entity: InputEntity ,
    async: false
    Here are more samples:
    https://xrmsvctoolkit.codeplex.com/SourceControl/latest#Samples/XrvSvcToolkit.Samples.updateRecord.js

  • How to update and delete using rest services in SharePoint 2013..

    I am looking to create,update and delete data in SharePoint list where i am using below code for creating data..I should be performing three operations on single button click how can i achieve this.Below is the code i am using for creating data to list and
    displaying in CEWP.
    <html>
    <head>
    <style type="text/css">
    #mytable{
    border : 1px solid;
    </style>
    <script type="text/javascript" src="https://sharepointapp28.sharepoint.com/sites/Dev2013/SiteAssets/Scripts/jquery-1.11.1.min.js" ></script>
    <script type="text/javascript">
    var ListName;
    var webUrl;
    $(document).ready(function(){
     SP.SOD.executeFunc('sp.js', 'SP.ClientContext', sharePointReady);//Doubt
    function sharePointReady() {
    webUrl = _spPageContextInfo.siteAbsoluteUrl;
    ListName = "test"; 
    $('#btnSub').click(function () {
    updateItem();
    function updateItem() {
    var name = $('#txtName').val();
    var Desc = $('#txtDesc').val();
    var city = $('#txtCity').val();
        var itemType = GetItemTypeForListName(ListName);
        var item;
            item = {
                '__metadata': { "type": itemType },
                'Name': name,
                'Description': Desc,
                'City': city
        var xmethod = 'POST';
        jQuery.ajax({
            url: webUrl + "/_api/web/lists/getbytitle('" + ListName + "')/items",
            type: "POST",
            data: JSON.stringify(item),
            contentType: "application/json;odata=verbose",
            headers: {
                "Accept": "application/json;odata=verbose",
                "X-RequestDigest": $("#__REQUESTDIGEST").val()
            success: onUpdateMSOPProcessSuccess,
            error: onUpdateMSOPProcesFail
        function onUpdateMSOPProcessSuccess(data) {
    alert('successfully updated to MyList!!!')
        function onUpdateMSOPProcesFail(data) {
            alert(data.d.err);
    function GetItemTypeForListName(name) {
        return "SP.Data." + name + "ListItem";
    </script>
    </head>
    <body>
    <table style="width:500px" id="mytable">
    <tr><td colspan="3">&nbsp;</td></tr>
    <tr><th colspan="3">Rest API</th></tr>
    <tr><td colspan="3">&nbsp;</td></tr>
    <tr><th>Name</th> <td> : </td> <td> <input type="text" id="txtName" /> </td></tr>
    <tr><th>Description</th> <td> : </td> <td> <input type="text" id="txtDesc" /> </td></tr>
    <tr><th>City</th> <td> : </td> <td> <input type="text" id="txtCity" /> </td></tr>
    <tr><td colspan="3">&nbsp;</td></tr>
    <tr><th></th><td colspan="2" align="left"><input type="button" value="submit" id="btnSub" /></th></tr>
    <tr><td colspan="3">&nbsp;</td></tr>
    </table>
    </body>
    </html>

    Hello,
    With one button you want to perform 3(Create, Update and Delete) operation
    To create:
    First check whether the data exist with full combination of Name,Desc and City.
    If not exist you can execute the create function.
    If exist, get confirmation to delete the item by pop up. Using item ID you can perform Delete operation
    To Update:
    How you want to update the item, by keeping unique value or combination of columns?
    based on that you can perform the update operation.
    Whenever you see a reply and if you think is helpful, click "Alternate TextVote As Helpful"! And whenever you see a reply being an answer to the question of the thread, click "Alternate TextMark As Answer

Maybe you are looking for