on 03-20-2019 2:26 PM
Hello guys,
can someone explain me, how the Update Action in Sap Mobile Dev. Kit works ?
I want to use my method UpdateEntity (Backend), but i don't know how execute it with OData actions.
I specified my service and my EntitySet but there are things like OData-Readlink and Update-Link required.
Unfortunately i can't define the Update Link.
Thank you for your help.
Greetings,
Timo
In MDK if you want to Update an existing Entity you would use an OData / UpdateEntity action type. When specifying this action you will need to set the target for the Update to the specific entity record you are updating. This is typically done through a read link that is usually available in the entity that provides the necessary pathing for the backend to know exactly which entity is being updated.
Typically when setting your target you will check the Read Link option and enter {@odata.readLink} as the value.
You would then specify the properties being updated along with their new values.
--Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
let's say - you have customer list and it's details page. you want to update customer details, so you create a new Edit customer details page where you have fields that you want to update or want to have as it is. You may add a button/action bar item e.g."Save".
You can call that "updateEntity" odata action on pressing "Save".
Coming back to your question -
when you create this "updateEntity" action, make sure to check "Read Link" box and then "insert to Expression"
The readlink is a direct reference to an individual entity set entry.
and then under Properties - select the ones you want to update and bind to respective UI control in object browser
select "value" for corresponding control
and "current page"
click on "insert to Expression"
It would be helpful in order to find controls by providing them a meaningful name
e.g. here in edit page, for "First Name" , i have given controls name as FCEditFirstName.
and then you can have A ClosePage (Completed) action on success of that odata action.
Regarding updateLinks, i haven't tried it yet, but looks like you can define it when you need to update associated entities.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your answers.
I think i found the Error.
It says it's sending a merge, but it's sending a post (which is wrong i guess).
Log(Cloud Platform):
Log (SAP):
And the request dies in the class shown on the screenshot below, before it jumps into the class of my OData Service.
Do you know, how i can fix that ?
Thank you for your help.
Greetings,
Timo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
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.