13
Views
3
Comments
Solved
SaveOnClick: Automatically assign value to tuple
Question

Hi everyone, 


I am currently working on a Task Manager. And every time I create a new task, it should automatically assign the status 'In Bearbeitung' to the task (German for 'in progress'). I tried to solve this by choosing ...Tasks.StatusID as my variable and as value ('In Bearbeitung' has the id 1 in my entity). But somehow it doesn't work. Probably it's not too complicated, but unfortunately I don't know what else I can try.

I have the same issue at a different place in my application. So probably I'm just using the Assign function wrongly.
But maybe someone knows what I'm doing wrong and help me out. :)

Thanks in advance!

Find my .oml attached

TaskManagerv2.oml

Rank: #70
Solution

Hi Raphael,


You have to assign the variable before creating the record.


Also, you might want to consider converting the table Status in a static entity (equivalent to enumerate in OutSystems) so you don't need to hardcode the id 1 and that warning to disappear.


Regards,
João

TaskManagerv2.oml

Rank: #68

Hello Raphael, 

The assignment must be done before invoking the Create action. By the screenshot you have this with the order reversed. 

Also if your Status is a static entity, assign entity.status.inProgress. 

Rank: #70
Solution

Hi Raphael,


You have to assign the variable before creating the record.


Also, you might want to consider converting the table Status in a static entity (equivalent to enumerate in OutSystems) so you don't need to hardcode the id 1 and that warning to disappear.


Regards,
João

TaskManagerv2.oml

Rank: #40226

Thanks to both of you! Especially the hint to convert my entities to static ones helped a lot.

All the best!