Creating an update database request on the click of button

Hi Everyone,
I am working on the update database functionality. when the button in drop down menu is clicked in review screen, the two options are review and assign. For assign button functionality, the database storage for assigned needs to be changed from the database.
I think we need to create an API update for it .

This is the progress i managed with some of the help but i am yet t o figure out from the basics.
Could anyone please review and help out

attaching .oml for reference

Revmaxclaimsummarypage (2).oml

You're passing the wrong value to the ClaimId input parameter. This is the correct value that needs to be passed:

Please don't take this the wrong way, since my only intention in saying it is to help you, but you seem to be struggling with some very basic OutSystems concepts. So I strongly suggest that you go through the online training in order to get a better understanding of the OutSystems fundamentals. Without a good grasp of the basics, you'll constantly find yourself struggling.

Best of luck!

The changes are:

  1. Create the 2 new local variables in GetAllClaims screen:
  2. Add a new input parameter to screen action OpenPopUp and pass its value on the "Assign" button's On Click event:
  3. Set the value of the "CurrentClaimId" variable in OpenPopUp screen action:
  4. Change the variable bound to the Dropdown to the new "CurrentAssignedTo" local variable:
  5. Change the assign in "ClosePopupOnClick" screen action as follows:

Hello Saif,

Currently, you are overwriting the entity attributes while updating AssignedTo .

(You are assigning only the values of ClaimId and the AssignedTo).

So, the remaining values are set as empty.


Solution,

Create a new function where it should update only the AssignedTo attribute.


Kind Regards,

Riyaz

Hi Saif,

I'm not sure what exactly is the problem you're facing here. Looking at your code, it seems to be correct. Is the Claim not being correctly updated in the database? If so, then please share the code of your "Update_Claim" server action.


Hi Aurelio Junior ,

Thank you for taking time to resolve this.
Yes the data is not getting updated when i click on the update button.
Not sure what you mean but the code of server action "Update_Claim"

Attaching screenshot for reconfirmation along with .oml file for reference.

Revmaxclaimsummarypage (2).oml

What I mean is that we need to see the code for the "Update_Claim" action that is implemented in module "RestExposeDemo":

It looks like this is the action that is updating the data in the database. So if the update is not working, there's probably something wrong with that action.

I understood now.. Attaching .oml file of restexposedemo  below

RestExposeDemo (1).oml

The problem is in the way you store the Id of the claim that is being edited and the "Assigned To" value. I've made some changes in your module to fix this (in attachment).

Some other things I've noticed:

  • You get the data to show on the screen from a REST API but update it directly in the database, which is a bit weird. Make sure the REST API is pointing to the correct URL, so that the data that is being shown is the same one you're updating.
  • Your "Assigned To" dropdown is using the same list as your Table. This results in only names which already have Claims assigned to them appearing in that list.
Revmaxclaimsummarypage.oml

Hi Aurelio Junior,
Thank you for your valuable inputs. What you have suggested seems to be the solution. Could you assist me with the process to make changes accordingly. Since i am a beginner i am uncertain about how to achieve it.
I checked your .oml file but unfortunately couldn't spot the changes based on the points you have mentioned. Looking forward to your help.

Attaching .oml file for reference


Revmaxclaimsummarypage (2).oml

The changes are:

  1. Create the 2 new local variables in GetAllClaims screen:
  2. Add a new input parameter to screen action OpenPopUp and pass its value on the "Assign" button's On Click event:
  3. Set the value of the "CurrentClaimId" variable in OpenPopUp screen action:
  4. Change the variable bound to the Dropdown to the new "CurrentAssignedTo" local variable:
  5. Change the assign in "ClosePopupOnClick" screen action as follows:

Made all the changes suggested. Missing something and unable to figure out what is wrong.

Attaching .oml file to review.
Could you please look at in your leisure time.


Revmaxclaimsummarypage (2).oml

You're passing the wrong value to the ClaimId input parameter. This is the correct value that needs to be passed:

Please don't take this the wrong way, since my only intention in saying it is to help you, but you seem to be struggling with some very basic OutSystems concepts. So I strongly suggest that you go through the online training in order to get a better understanding of the OutSystems fundamentals. Without a good grasp of the basics, you'll constantly find yourself struggling.

Best of luck!

Hi Aurelio,
Will definitely start with the videos from learning paths again. just to make sure the basics are understood properly.

Made Changes as suggested. Could you please suggest.


Revmaxclaimsummarypage (2).oml

Hi Aurelio Junior

The data is getting erased when the assigned button functionality is used. Could you please help out 



Revmaxclaimsummarypage (2).oml

Hello Saif,

Currently, you are overwriting the entity attributes while updating AssignedTo .

(You are assigning only the values of ClaimId and the AssignedTo).

So, the remaining values are set as empty.


Solution,

Create a new function where it should update only the AssignedTo attribute.


Kind Regards,

Riyaz

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.