CreateOrUpdate is not creating but only updating the table


I'm a newbie to Outsystems. I'm trying to create an application where I can insert new data and also updating on one page. I'm using the CreateOrUpdate Entity to do the same. But every time I upload a new data it is overwriting on the old and not creating a new one. I also noticed that the ID has not changed, hence this is happening. I am trying to make the ID to a null identifier, the ID inserts a new row instead of updating the same row but when  I am trying to search back, the data do not appear on the screen. 

Eg : 

1) I have this information: School : A Year : 2012  

2) I want to insert another information but different Year : School: A and Year : 2013

3) When I am using createorupdate with null identifier , the new data inserted in the table with new row

4) I'm trying to search the data School: A and Year: 2013 but the data is not appear

Thanks in advance,


Rank: #17


Welcome to the OutSystems Community!

Maybe you can share your .oml file here so someone can check your code and see what you did wrong.

That said it looks like you tried to code what OutSystems can all automatically can generate for you, when you scaffold a list and detail screen.

To scaffold a list and detail screen with add, update and search functionality you only need to drag your entity to the UI flow.

For reactive web both screens are then automatically created. For traditional web you have to drag the entity two times, the first time the list screen is created the second time the detail screen.




Rank: #135

Hi Fathin,

Please follow the below steps to solve the issue,

1. Verify the entity data.

2. Verify the aggregate conditions.

3. Test with sample data.

4. Also debug the code once you verified the above steps

Apart from the above step,

You can easily understand the functionality using scaffolding feature

1. Create entity 

2. Right click on newly created entity and select create list screen option.

3. Right click on the entity again and select detail screen option.

4. Publish code and test.