ToDo Mobile App (OS Course) Error when creating new ToDo even with QuickStart Module

ToDo Mobile App (OS Course) Error when creating new ToDo even with QuickStart Module

  

Hi community, 

I'm doing the ToDo App as part of the Labs within the Developing Mobile Apps online Course.

After the "offline exercise" I can no longer create a new To Do because I get the message shown in the attached picture. I've used the modules provided in the QuickStart folder of the Lab to find out if I had missed a step, and I still got the same error message. 

Has someone encountered the same issue with the lab? 


Thanks! 

Gaby

Solution

Hi Gaby,

I haven't done the exercise myself but are you choosing the priority before saving? Looks like it's mandatory and you are not sending it back to the server...

Solution

Hi Gaby,

João is right. What is happening is you're trying to create a new ToDo record, but you haven't selected any of the Priority choices there (Low, Medium or High)... as such the PriorityId attribute, that is Mandatory, will have NullIdentifier() as it's value and the database will complain there's no PriorityId defined for the ToDo. This would easily be fixed if:

a) the platform's built-in validations worked on Group Buttons (but they currently don't seem to), or;
b) you explicitly check, as part of your custom validations, if a Priority has been selected.

Anyways, in order to continue the exercise you just need to choose a Priority while creating a ToDo, it has nothing to do with the Offline Exercise per se.

Thanks guys! thanks Jorge for the explanation. Right---- it's mandatory! 

Question: if PriorityId is Mandatory, then why isn't the platform defining the  Mandatory property of the Priority ButtonGroup as TRUE automatically, considering the Variable property is PriorityId ?

thanks! 

Gaby wrote:

Question: if PriorityId is Mandatory, then why isn't the platform defining the  Mandatory property of the Priority ButtonGroup as TRUE automatically, considering the Variable property is PriorityId ?

You're right, there's a mandatory property in the ButtonGroup, so built-in validations actually work for GroupButtons, (I was temporarily puzzled by it just now :P)

As for why the platform doesn't do it automatically... ServiceStudio only does it automatically for scaffolded things (e.g. drag and drop an entity attribute and it creates the appropriate Input), since GroupButtons are never generated (you have to explicitly choose to use them) that bit makes sense...

However, I do believe it should show a warning like it does for all other inputs when the Mandatory property of the widget doesn't match the Is Mandatory property from the entity's Attribute.

Jorge Martins wrote:

Gaby wrote:

Question: if PriorityId is Mandatory, then why isn't the platform defining the  Mandatory property of the Priority ButtonGroup as TRUE automatically, considering the Variable property is PriorityId ?

You're right, there's a mandatory property in the ButtonGroup, so built-in validations actually work for GroupButtons, (I was temporarily puzzled by it just now :P)

As for why the platform doesn't do it automatically... ServiceStudio only does it automatically for scaffolded things (e.g. drag and drop an entity attribute and it creates the appropriate Input), since GroupButtons are never generated (you have to explicitly choose to use them) that bit makes sense...

However, I do believe it should show a warning like it does for all other inputs when the Mandatory property of the widget doesn't match the Is Mandatory property from the entity's Attribute.

Thanks Jorge!