Hey guys. I'm just following 8.2x of Mobile Tutorials and my outsystems doesnt seem to be able to "GetLocalToDoByID" In expression 

Anyway to make "GetLocalToDobyID" Valid? OML is attached here.

https://drive.google.com/drive/folders/1BwGSJPAU1Qdh1mPgsNKXPt_0AEPsUOcp?usp=sharing

Thankyou

The name on the agregate of the local ToDo you have has a different name, it is "GetToDos" and not "GetLocalToDoByID"

And also you do not have that query filtered by id, on the detail page you are getting all the ToDo records

Xing Yu Choo wrote:

Hey guys. I'm just following 8.2x of Mobile Tutorials and my outsystems doesnt seem to be able to "GetLocalToDoByID" In expression 

Anyway to make "GetLocalToDobyID" Valid? OML is attached here.

https://drive.google.com/drive/folders/1BwGSJPAU1Qdh1mPgsNKXPt_0AEPsUOcp?usp=sharing

Thankyou

Hi Xing Yu Choo,

I went through your oml. Few things are missing in the oml. 

1. There is no filter in the aggregate GetToDos.

2. The name of your aggregate is GetToDos. So the source for the UpdateLocalToDo must be 

SyntaxEditor Code Snippet

GetToDos.List.Current

3. The assign statement should be 

SyntaxEditor Code Snippet

GetToDos.List.Current.LocalToDo.Id


4. In the CreateLocalToDo source should be 

SyntaxEditor Code Snippet

GetToDos.List.Current

Hope this helps you!!!

Priya Khade wrote:

Xing Yu Choo wrote:

Hey guys. I'm just following 8.2x of Mobile Tutorials and my outsystems doesnt seem to be able to "GetLocalToDoByID" In expression 

Anyway to make "GetLocalToDobyID" Valid? OML is attached here.

https://drive.google.com/drive/folders/1BwGSJPAU1Qdh1mPgsNKXPt_0AEPsUOcp?usp=sharing

Thankyou

Hi Xing Yu Choo,

I went through your oml. Few things are missing in the oml. 

1. There is no filter in the aggregate GetToDos.

2. The name of your aggregate is GetToDos. So the source for the UpdateLocalToDo must be 

SyntaxEditor Code Snippet

GetToDos.List.Current

3. The assign statement should be 

SyntaxEditor Code Snippet

GetToDos.List.Current.LocalToDo.Id


4. In the CreateLocalToDo source should be 

SyntaxEditor Code Snippet

GetToDos.List.Current

Hope this helps you!!!


Hi.

Thank you for your help! I've managed to fix the issue. Just 1 question,

What filter do i put in the aggregate GetToDos? I've tried refering to the one i have placed in my database and adding a Local to ToDo, "LocalToDo.UserId = GetUserId()", entity and it cant recon "UserID".

Sorry if im asking really bad questions... Third day into this and my head is spinning~

Xing Yu Choo wrote:

Priya Khade wrote:

Xing Yu Choo wrote:

Hey guys. I'm just following 8.2x of Mobile Tutorials and my outsystems doesnt seem to be able to "GetLocalToDoByID" In expression 

Anyway to make "GetLocalToDobyID" Valid? OML is attached here.

https://drive.google.com/drive/folders/1BwGSJPAU1Qdh1mPgsNKXPt_0AEPsUOcp?usp=sharing

Thankyou

Hi Xing Yu Choo,

I went through your oml. Few things are missing in the oml. 

1. There is no filter in the aggregate GetToDos.

2. The name of your aggregate is GetToDos. So the source for the UpdateLocalToDo must be 

SyntaxEditor Code Snippet

GetToDos.List.Current

3. The assign statement should be 

SyntaxEditor Code Snippet

GetToDos.List.Current.LocalToDo.Id


4. In the CreateLocalToDo source should be 

SyntaxEditor Code Snippet

GetToDos.List.Current

Hope this helps you!!!


Hi.

Thank you for your help! I've managed to fix the issue. Just 1 question,

What filter do i put in the aggregate GetToDos? I've tried refering to the one i have placed in my database and adding a Local to ToDo, "LocalToDo.UserId = GetUserId()", entity and it cant recon "UserID".

Sorry if im asking really bad questions... Third day into this and my head is spinning~

Hi,

SyntaxEditor Code Snippet

LocalToDo.Id = LocalToDoID

You need to add this filter in your aggregate.

Hope this helps you!


Priya Khade wrote:

Xing Yu Choo wrote:

Priya Khade wrote:

Xing Yu Choo wrote:

Hey guys. I'm just following 8.2x of Mobile Tutorials and my outsystems doesnt seem to be able to "GetLocalToDoByID" In expression 

Anyway to make "GetLocalToDobyID" Valid? OML is attached here.

https://drive.google.com/drive/folders/1BwGSJPAU1Qdh1mPgsNKXPt_0AEPsUOcp?usp=sharing

Thankyou

Hi Xing Yu Choo,

I went through your oml. Few things are missing in the oml. 

1. There is no filter in the aggregate GetToDos.

2. The name of your aggregate is GetToDos. So the source for the UpdateLocalToDo must be 

SyntaxEditor Code Snippet

GetToDos.List.Current

3. The assign statement should be 

SyntaxEditor Code Snippet

GetToDos.List.Current.LocalToDo.Id


4. In the CreateLocalToDo source should be 

SyntaxEditor Code Snippet

GetToDos.List.Current

Hope this helps you!!!


Hi.

Thank you for your help! I've managed to fix the issue. Just 1 question,

What filter do i put in the aggregate GetToDos? I've tried refering to the one i have placed in my database and adding a Local to ToDo, "LocalToDo.UserId = GetUserId()", entity and it cant recon "UserID".

Sorry if im asking really bad questions... Third day into this and my head is spinning~

Hi,

SyntaxEditor Code Snippet

LocalToDo.Id = LocalToDoID

You need to add this filter in your aggregate.

Hope this helps you!


May i ask what does this filter do?


Hi Xing Yu Choo,

That filter makes sure your aggregate only returns one record, the LocalToDo with the Id you receive as Input Parameter.

Jorge Martins wrote:

Hi Xing Yu Choo,

That filter makes sure your aggregate only returns one record, the LocalToDo with the Id you receive as Input Parameter.


So it's to make sure the user who input it gets to see what they input and it makes sure other users dont see the same input based on ID?

If so shouldnt it have UserID() somewhere? Or is it because this is local storage?

Xing Yu Choo,

No, it just guarantees that it shows the right ToDo, doesn't restrict it to any particular user. Given that it's a LocalStorage entity, it will get its data from the device's LocalStorage so it will be restricted to whatever is stored there.

Hi Xing Yu Choo,

Go through the exercise material throughly. In the pdf you are refering to they have provided you with each and every minute details. 

Your doubt: In your screen you have an input parameter LocalToDo and you have used that parameter in the aggregate which you have mapped to the form from where the user inputs the details on the screen. This filter ensures that the aggregate returns only single record which you have passed via input parameter.


GetUserId() function returns the Id of the user that is currently authenticated with the service.

Hope this helps you!

Jorge Martins wrote:

Xing Yu Choo,

No, it just guarantees that it shows the right ToDo, doesn't restrict it to any particular user. Given that it's a LocalStorage entity, it will get its data from the device's LocalStorage so it will be restricted to whatever is stored there.

I think i understand it a little.

It acts as a 'search' function? Meaning to say the filter allows me to get back what i've previously input based on what i clicked on the 'ToDos' Screen? Please correct me if i am wrong.

Thank you for your help :) 


Yes, the LocalToDoId you pass as input parameter to the 'ToDoDetail' Screen (and are using in this filter) identifies a single record in the LocalStorage database. Using it in the Aggregate filter like this makes sure the Aggregate will return the record you clicked on the 'ToDos' Screen, allowing you to display that specific Todo's information in the 'ToDoDetail' Screen.

Priya Khade wrote:

Hi Xing Yu Choo,

Go through the exercise material throughly. In the pdf you are refering to they have provided you with each and every minute details. 

Your doubt: In your screen you have an input parameter LocalToDo and you have used that parameter in the aggregate which you have mapped to the form from where the user inputs the details on the screen. This filter ensures that the aggregate returns only single record which you have passed via input parameter.


GetUserId() function returns the Id of the user that is currently authenticated with the service.

Hope this helps you!

I've reached this obstacle when following the PDF exercise materials... 

This error pops up when i do apply the filter to the aggregate 'GetToDos' though... 

Jorge Martins wrote:

Yes, the LocalToDoId you pass as input parameter to the 'ToDoDetail' Screen (and are using in this filter) identifies a single record in the LocalStorage database. Using it in the Aggregate filter like this makes sure the Aggregate will return the record you clicked on the 'ToDos' Screen, allowing you to display that specific Todo's information in the 'ToDoDetail' Screen.


Thank you for clarifying my doubt! 

Solution

Xing Yu Choo,

You are editing the Aggregate on the wrong screen... that filter only makes sense on the 'ToDoDetails' Screen (where the LocalToDoId is the Input Parameter that identifies which ToDo you want to display). On the 'ToDos' Screen you don't want to filter by Id, as you want to display a list of ToDos, not one specific record.

Solution

Xing Yu Choo wrote:

Priya Khade wrote:

Hi Xing Yu Choo,

Go through the exercise material throughly. In the pdf you are refering to they have provided you with each and every minute details. 

Your doubt: In your screen you have an input parameter LocalToDo and you have used that parameter in the aggregate which you have mapped to the form from where the user inputs the details on the screen. This filter ensures that the aggregate returns only single record which you have passed via input parameter.


GetUserId() function returns the Id of the user that is currently authenticated with the service.

Hope this helps you!

I've reached this obstacle when following the PDF exercise materials... 

This error pops up when i do apply the filter to the aggregate 'GetToDos' though... 

Hi Xing Yu Choo,

Your ToDos screen just displays the list of the records. So there's no need to add any filter on that screen.

You need to add this filter in the ToDoDetail screen in the GetToDos Aggregate. You already have added one input paramter, you just need to add the filter in the aggregate.

Hope this helps you!!! 


Jorge Martins wrote:

Xing Yu Choo,

You are editing the Aggregate on the wrong screen... that filter only makes sense on the 'ToDoDetails' Screen (where the LocalToDoId is the Input Parameter that identifies which ToDo you want to display). On the 'ToDos' Screen you don't want to filter by Id, as you want to display a list of ToDos, not one specific record.


Omg I am not the smartest man out there.

Thank you. You've been a great help.


To double confirm, by inputting this filter i essentially tag an ID number to whatever I've input as 

LocalToDo.ID (shown here) 

is then assigned a number by the function 'LocalToDoID' which is an autonumber function(?) 


Hi Xing Yu Choo,

Each LocalToDo record will have a unique Id attribute which is considered the primary key (a number that uniquely identifies one record on your local storage database), that can be Auto Number - managed by the platform - or not, based on what you defined on your LocalStorage Entity (by default it would be Auto Number).

When you add the filter LocalToDo.Id = LocalToDoID to your Aggregate, you are telling the platform to only fetch LocalToDo records that have an Id attribute equal to the one you passed as the LocalToDoID input parameter of your Screen. Since the Id is guaranteed to be unique, the filter makes your Aggregate return at most one LocalToDo record (either it finds the record that has the requested Id or it doesn't find any record).