Hi,

Inserting a 'To Do' with a Priority (Low, Medium or High) will store the record in the database. Opening the same record again and save it for the second time will give an Required field! error. 

The ToDo.PriorityId = 2. So, it looks like everything is fine. What might it be??

Regards, René

In the screen shot it is showing the record, but not necessarily what the widget. If the widget isn't holding the value, that is the problem. If you want to share your entire application that might help. The solution is probably on load, fi the ID is not NULL to make sure to bind the values properly


Hi Stacey,

A little late, but here is the OML. I hope you can find the reason why the field should be updated.


Regards, René

Your button group is just tied to the Entities. Its not at all tied to the data. You need to tie it to data that is coming back from the database.

ButtonGroup1 has a variable GetToDoById.List.Current.ToDo.PriorityId. I'll guess this is set to two confirm the database. If you have a look at ToDo.PriorityId.jpg (original message) you'll see the Priority is set to medium as well, but still the Required field message is shown. I'll guess it's a bug??

Hi Rene,

I am doing the same lab and had the same problem. I  think is really a bug. Im my case i solved the problem changing the mandatory as false in the bottomgroup and inserting a condition in the SaveOnClick action (see attached image.    


Hi Gilberto,

I'ts the same way I 'solved' it!

I also have the same problem.  My button group is bound to the PriorityId of my entity but I still get the required validation message unless I make a change to the priority first.  Sounds like a bug to me.

Same here. I even tried setting it in the OnAfterFetch of the aggregate to force a value. It didn't work.

Same problem for me. Wish I'd searched for this earlier!

Gilberto Altschul wrote:

Hi Rene,

I am doing the same lab and had the same problem. I  think is really a bug. Im my case i solved the problem changing the mandatory as false in the bottomgroup and inserting a condition in the SaveOnClick action (see attached image.    



Appreciated the screen shot. It looks like if it is an existing ToDo item, we are hardcoding it to Priority.Low? Is it possible to get the on-screen selection? Thanks!

René Cornet wrote:

Hi,

Inserting a 'To Do' with a Priority (Low, Medium or High) will store the record in the database. Opening the same record again and save it for the second time will give an Required field! error. 

The ToDo.PriorityId = 2. So, it looks like everything is fine. What might it be??

Regards, René

We arrived at a solution in Meta3 for this problem, we set the mandatory property to the following expression:

Same problem in 4.4 exercise. I asked my colleague, Steve, if he had had the same issue. He did the course in IDE 10 long ago. So, he ran thru this exercise - same issue.

But his solution is really elegant! In the mandatory property of the button group, he put this:

   ToDoId = NullIdentifier()

As the button group does not permit setting the priority to a null identifier when editing an existing To Do, the priorit stays the same. As the creation of a new To Do sets the priority to a null identifier, no priority is set and the mandatory condition above ensures that the user enters a selected priority.

Brilliant Steve, thanks.Elegant and it works - lovely combination.