on 04-06-2016 6:00 AM
Hi,
I have implemented a CREATE_DEEP_ENTITY function in Data Model , how to call this function from UI ?
can we call CREATE_DEEP_ENTITY function using oModel.create() ? if yes then how?
What all are the ways to call CREATE_DEEP_ENTITY function from UI(Front end)?
Hi Manish
Yes you can call it using oModel.create().
1) Create a oDataModel : = sap.ui.model.odata.ODataModel(url);
2) Make an array for item data : itemData = [];
3) itemData.push ({ Cid '123'. Vid '1111', vname: 'XYZ'});
itemData.push ({ Cid '124'. Vid '1222', vname: 'ABC});
4) Create request body : var requestBody = {};
requestBody.cust_id = '123';
requestBody.cust_name = 'YYY';
5) Add ItemData to request : requestBody.<navigation_name> = itemData;
eg: requestBody.Vendors = itemData;
6) Issue Create : oModel.create('/<collection_name>', requestBody, null, function() { alert ('success')}, function() { alert('failed'} );
eg: oDataModel.create("/CUSTOMERS" , requestBody, null, fsuccess,ferror);
Regards
Kanika
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.