531
Views
5
Comments
Solved
Add New Record instead of Editing Current Record in Form
Application Type
Reactive
Service Studio Version
11.10.13 (Build 39572)
Platform Version
11.11.0 (Build 27311)

Hi there.

I want to add a form on my homepage that creates a new entry into my current database, and then updates the entry. However, I have only been able to figure out how to EDIT an existing / current record, rather than create a new one using a form via the outsystems guided paths.


Help with this would be very much appreciated.


Screenshot20210308105855.png
2021-06-01 05-56-33
Komal Kumbhar
Solution

Hi,

The aggregate you are giving to the form's source, make its fetch property to "On Demand" and also you can clear the form data after creating the data. 

If the screen is rendering from one screen to another screen then you can use Entity.Id = Nullidentifier() as mentioned by Jose Goncalves.


Regards,

Komal

2021-04-17 09-53-48
José Gonçalves

You need to open the URL with the Id parameter = NullIdentifier()

like this: ... ProductColorDetail?ProductColorId=0



2021-08-12 11-00-27
Nordin Ahdi
 
MVP

Hi Jose and Joshua,

@Jose Goncalves This would not work as the OP is working on a Reactive Web App.

Furthermore, it is best practice to pass NullIdentifier() instead of 0 to the EntityId parameter of the screen in order to create a new record.

Hope this helps.

Regards,

Nordin

EDIT: the post was corrected by Jose.

2021-04-17 09-53-48
José Gonçalves

Yes, I meant 0 in the URL but oc using nullidentifier() as the parameter. Thanks for the note.

2021-08-12 11-00-27
Nordin Ahdi
 
MVP

No problem. The note was more about having the .aspx extension in the URL which only works for Traditional Web Apps.

2021-06-01 05-56-33
Komal Kumbhar
Solution

Hi,

The aggregate you are giving to the form's source, make its fetch property to "On Demand" and also you can clear the form data after creating the data. 

If the screen is rendering from one screen to another screen then you can use Entity.Id = Nullidentifier() as mentioned by Jose Goncalves.


Regards,

Komal

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.