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

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

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

like this: ... ProductColorDetail?ProductColorId=0



mvp_badge
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.

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

mvp_badge
MVP

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

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.