Hello, 


IM trying again  the mobile track but now im running into this one : 



I will include the core oml file 

Did you copy and deleted the copied user entity?

hmm, I do not have made a user entity. I only have made a category, priority, resource, resourseType and a todo enitity. 


Or do I misunderstood you 

Hello Roelof,

This is an error that happens when you try to insert a record in the database (in this case it is the ToDo entity), but didn't provide a valid value of an Foreign Key (FK) that is mandatory (in this case, UserId).

So, your entity ToDo has an FK UserId (User Identifier) that is mandatory.

Two reasons for this to happen:

1. You didn't set the value, so it is sent empty to the database

2. You are setting, but you are not logged in, so you are sending an empty value to the database.

So, the problem is not at your core module, but at your interface module. You probably needs an assignment in your logic, before using the CreateOrUpdateToDo, to set the value of the UserId attribute (using a GetUserId()).

If you are following the online training, you probably skipped a step.

Hipe this helps.

Cheers.

P.S. (or, when you created the ToDo entity, the UserId should not be marked as mandatory, I don't remember, would have to check it).

the tutorial is saying this :

Enter UserId for the name of the attribute and make it mandatory. Notice the
Data Type is automatically set to User Identifier. 


but I think I messed up more then I thought by renaming things 


Database Integrity Suggestion

Inconsistent database table and entity definitions: column 'OSUSR_x8w_ToDo.PRIORITYIDENTIFIER' exists in database, but there is no corresponding attribute in entity 'ToDo'.


and that is right because I renamed it to ProirityId as the tutorial is stating 

Solution

Hi, 

the warning is saying that you have a column in the table in database that is not present in the Entity definition (in OutSystems).

This happens when you delete an attribute of the entity. To be able to revert this (and keep the data, if it exists), the platform does not delete the column in the database.

So, for now, this is not a problem.
And it is not the cause of the error you saw.

I recommend you to review the steps related to Saving a ToDo, in order to identify if you skipped something (almost for sure).

For example, in exercise 4.4 was asked of you this:

This is what guarantees that the ToDo will be saved with a valid User Identifier.

If this is in place, check if you are using the GetToDoById.List.Current as the source of the CreateOrUpdateToDo.

And be sure you are logged in when trying to save a ToDo, or the GetUserId() will return zero (0) and this will also cause the same error.

Cheers.

Solution

Checked everything and it seems fine.

I will also include  the other module because the error message stays.

Hi Roelof,

Checked your module and you are missing the the step Eduardo mention in his last post. Follow his instructions and you will solve your problem.

Regards,

Macelo