cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
HerrMueller
Frequent Visitor

Create record and show newly created record

Hi folks,

 

we have a PowerApp in development which shows records from the Dataverse in a gallery view.

By clicking on a record entry, a page ("General") opens, where some fields are available to edit the record, existing data is loaded into these fields.

We also have a functionality in our app to create whole new records. This functionality links the same "General" page where the same fields are available, but empty.

By clicking on the save button on the "General" page, a patch function runs to create the record in the Dataverse.

So far, so good. 

We want to keep the page opened after the patch with the data from the newly created record shown (so technically close the "create page" and open the "edit page" with data from the new record).

But currently all data will be removed from the fields after the patch, so the page is shown in "create form" again.

 

Any advice on how to achieve this?

 

We already tried several things, which worked also out in the editing mode, but after publishing the app, a lot of error messages were thrown...

 

Open the Create page:

 

Create_Button.OnSelect = Set(selectedRecord; Defaults('Meeting Minutes'));;
Navigate(General);;
General_Form_BasicFields.Items = selectedRecord

 

 

Function on the Save button:

 

Save_Button.OnSelect =

If(
IsBlank(Validate('Meeting Minutes'; selectedRecord; General_Form_BasicFields.Updates; General_Form_Description.Updates; General_Form_Subject.Updates ));

//true

Set(selectedRecord; Patch('Meeting Minutes'; selectedRecord; General_Form_BasicFields.Updates; General_Form_Description.Updates; General_Form_Subject.Updates);;
EditForm(General_Form_BasicFields);;EditForm(General_Form_Description);;
EditForm(General_Form_Subject);;

Notify("Your Meeting Minutes was created successfully.";
NotificationType.Success
);

//false
Notify(
First(Errors('Meeting Minutes')).Message;
);;

)

 

 

Any advice is appreciated! 

0 REPLIES 0

Helpful resources

Announcements
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Users online (1,686)