Use Value in Save Action

Use Value in Save Action

I have in my edit (create) page a place at the top of the Id of another entity. I want to be able to click on save and use that in to determine the current item in that other entity.
Hi Michael,

I couldn't quite understand the exact scenario or what your particular doubt was. Could you elaborate a bit more, please?

I assume you're talking about the entity being edited having an attribute which is a foreign key to some other entity that you also want to specify (maybe with a ComboBox) on Save, but I'm not sure. Can you please confirm?


Basicly, I am making a payment system, in which I want it to take and subtract the amount and subtract it from that record. How it should find it is by it Id (Ticket) which is just a textbox where the end user could input a number. What I am having issues is getting my save action to use that number to locate the other record so it can then be edited and then saved. I hope this helps.

I'm still not 100% sure I got it, but is something like:

1) You have a screen where you have an Edit Record to edit entity A;
2) You also want to add an extra row to the Edit Record, containing a simple input, where the user will type in the Id of a (related) entity B;
3) When user presses a "Save" button, you want to update not only the obvious entity A, but fetch entity B (with the Id the user inputted on the "extra" row), do some processing there and save the modified record of B too, all in one go;

If that's the case, then that isn't difficult at all to accomplish in the OutSystems Platform. Having said that, in case I'm totally missing your point, if you could please provide a sample of the screen you're envisioning (snippet of OML, or just a mockup) we could take it from there more effectively.


That is extactly what I am wanting to do. I have uploaded my .oml just in case you would like to view it.
BTW, if you look at the OML, the A Entity Edit is the Payments and the B Entity is the Pawns.
Hi Michael,

Finally had a chance to look at your eSpace. It seems to me that you are pretty close to the full solution already! :)

You just need to update the Pawn record (that you're already fetching) in the DB, inside the Save action of your Payment_Edit screen. If you add a call to UpdatePawn and pass in GetPawnbyTicket.List.Current it should do the trick! Just place this new node somewhere near your invocation of CreateOrUpdatePayment (add it just before or immediately after, it doesn't matter).

BTW, for simplicity, feel free to remove the Payment entity (and the related condition) from inside the GetPawnbyTicket query as you don't need it to fetch the Pawn.

Let me know if it worked. Cheers,