7 hours ago
Hello community! As always, thanks for your help. I have the following problem...
I have a page called "Noticias_Detail.page", this page has two buttons: "Me gusta" and "No me gusta". The first button creates a record in the "NOTICIAPERSONALIKE" Entity database with its "LIKE" property set to "true". Right now everything works fine... so when I come back to this page and press the "No me gusta" button, my idea is to update the property of the previous record, making the "LIKE" property value false. This is my setup:
And this is my odata action to update entity:
When i try to press the "No me gusta" button I get the following error:
I can't figure out what's going on. If I try to access this record in my CAP service, I can see it:
These are the entities in my CAP service (if that helps):
entity NOTICIA : cuid, AUDITORIA {
TITULO : String100;
CUERPO : String5000;
EMPRESA: Association to one EMPRESA;
AREA : Association to one AREA;
AUTOR : Association to one PERSONA;
NOTICIAPERSONALIKES: Composition of many NOTICIAPERSONALIKE on NOTICIAPERSONALIKES.NOTICIA = $self;
}
entity NOTICIAPERSONALIKE : cuid, AUDITORIA {
NOTICIA : Association to one NOTICIA;
USUARIOLIKE : Association to one PERSONA;
LIKE : Boolean default true;
}
I accept any help or suggestion, thanks
To update the likes records when returning you need to target the specific like record. The error message indicates you are trying to target the navigation property from the NOTICIA record instead of the NOTICIAPERSONALIKE record.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the help, I still have the same problem. I don't understand what I'm doing wrong, I'm sharing screenshots of the entire process:
In this view I see all the available news
When I select a particular one, I enter the detail view:
The "No me gusta" button triggers the following action:
And I get the following error:
I've tried many variants and none of them work.
User | Count |
---|---|
70 | |
10 | |
8 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.