cancel
Showing results for 
Search instead for 
Did you mean: 

Issues in Posting Data

former_member187227
Participant
0 Kudos

Hi all,

  I tried this code for  posting data but its not working i'm getting error like Method 'POSTADVERTSET_CREATE_ENTITY' not implemented in data provider class. Any other code i missed here. please correct it.. Thanks in advance.

CODE:

Posdata: function(evt){

          var oModel = this.getView().getModel();         

          var vProperties = {};         

 

        

        

           vProperties.Offid="0000366";

          vProperties.Rcins="00000043";

          vProperties.Pbdat="2015-07-30T00:00:00";

        

          vProperties.Vldat="2015-07-30T00:00:00";

        

          vProperties.Pcost="300";

        

          vProperties.Idtxt="ODATA TEST";

          vProperties.Curry="USD";

               //vProperties.Id = 0;

               oModel.createEntry("PostAdvertSet", vProperties);

       

          oModel.submitChanges(this._fnSuccess, this._fnError);        

          oModel.refresh();

   

},

former_member187227
Participant
0 Kudos

Hi  Florian Pfeffer,

     I Check with my back end people and short out that issue now the following errors are thrown may be in binding i made any mistake. Please give some idea to bind the new Odata with view.

ERROR:

Element sap.ui.core.mvc.XMLView#__xmlview2: aggregations with cardinality 0..n only allow binding paths as attribute value (wrong value='')

pfefferf
Active Contributor
0 Kudos

Hi,

there is somewhere a wrong binding syntax in your XML view. But w/o the code it is hard to give an exact error description .

Best Regards,

Florian

former_member187227
Participant
0 Kudos

Hi Florian Pfeffer,

            This is my code using in the controller.js file.

CODE:

    onInit : function(evt) {

          this.getView().addDelegate(

                    {

                         onBeforeShow : function(evt) {

                              var oModel3 = new sap.ui.model.odata.ODataModel(

                                        "{/PostAdvertSet}");

                              evt.to.setModel(oModel3);

                         }

                    });

    },

Posdata:function(){

  var oModel3 = this.getView().getModel();          

          var vProperties = {};    

              vProperties.Offid="";

               vProperties.Rcins="00000043";

               vProperties.Pbdat="2015-09-25T00:00:00";

               vProperties.Vldat="2015-09-25T00:00:00";

               vProperties.Idtxt="Manager Post";

               vProperties.Pcost="120.00";

               vProperties.Curry="USD";

               oModel3.createEntry("/PostAdvertSet", vProperties);

          oModel3.submitChanges(this._fnSuccess, this._fnError);         

          oModel3.refresh();

}

Accepted Solutions (0)

Answers (0)