Hi, I am trying to learn about REST API service in outsystems so I planned to do simple get create update and delete funtions in REST API. All works fine except Update. I've attached an OML please take a look and tell me where I've gone wrong.
Problem is Update screen appears to be non editable. Please tell me how to fix it.
On your form the enabled property is set to false.
Stacey Levine wrote:
Thank you. I didn't see it coming ;) .
I changed but still there is some problem in update function still. Its not updating (not reflecting the change in database). Please help.
I do not understand your use case here, as you could simply manipulate your DB directly using Aggregates/SQL on every action (Create, Update, Delete), but I assume you are just aiming at using REST APIs with OutSystems.
The problem is: you need to expose your APIs and build the logic associated to each one of them (Creating, Updating, etc), instead of consuming them. This way, you can later use their endpoint to call them (locally within the application or remotely from other applications), to perform actions over your DB.
As of now, you are consuming APIs which do not exist on your application.
Pedro Santos wrote:
I did already published(Exposed) it on another application. Take a look at this oml.
I apologize for that, it was unclear to me.
I know what the problem is: the variable for each Input widget inside your Form (ProductsForm) is not correctly defined, as they point to the response of your GetProducts call, instead of the entries of the Record itself (within the Form).
This way, when you call the UpdateProduct API with ProductsForm.Record as input, information will be propagated. Otherwise, it won't.
I hope this fixes your issue!
No need to apologize. You fixed it anyway. Thanks. I also need to ask you something. For the start I worked on this simple get create update and delete funtions on REST API.
As I have some idea about it now. What are the things I need to practice or study to get know about the REST API and what are the things it is capable of .
Is there any sample application which explains what does and what can the REST API can do in outsystems or Do you have any idea in your mind for what am seeking?
Good, that your problem is solved!
I would recommend you search online for available documentation and how-tos on the matter, like for instance:
There is a lot of information online, at a one-click (and some typing) distance!