Hello Power Apps Community,
I hope you can help please, as I'm going around in circles. This post is long, sorry. But wanted to give some context.
In short, when create a new record via a form, how can I make it show the newly created record, and not the record I was previously viewing?
I've created a canvas app in Dataverse for Teams.
I have 2 tables "Employee" and "Transaction". It's a one to many relationship, so 1 Employee can have many Transactions.
The process is that on a gallery of Employee records I select one record and pass this information into a gallery of Transactions on another screen. So I see all Transactions for the Employee in the second gallery.
In the second gallery that is showing all Transactions, I then want to select a single Transaction record and navigate to a form to show more information about the Transaction. The OnSelect property for the selected records in the Transaction gallery has the below formula.
galTransaction.Selected;
Navigate(
ScreenDetailTransaction,
ScreenTransition.None
)
So I land on the ScreenDetailsTransaction
It has a form called frmDetailTransaction
Its Item property is galTransaction.Selected
If I click the pencil icon to edit the form frmDetailTransaction
Its OnSelect property is below:
Navigate(
ScreenEditTransaction,
ScreenTransition.None
)
This takes me to another screen called ScreenEditTransaction
This screen has another form on it called frmEditTransaction
Its Item is galTransaction.Selected this might be where I'm having a problem, but who knows...?
Here I make my change to the Transaction record and save.
Its OnSelect property is SubmitForm(frmEditTransaction)
Its OnSuccess property is below
Navigate(
ScreenDetailTransaction,
ScreenTransition.None
)
This then submits the changes to the database and takes me back to the screen ScreenDetailTransaction so that I can view the record.
This is working perfectly... Now, after all that... The problem I am experiencing is, if you look at the screenshot above, there is a + icon. This is to create a new Transaction record.
Its OnSelect property has the below formula:
NewForm(frmEditTransaction);
Navigate(
ScreenEditTransaction,
ScreenTransition.None
)
So this takes me to the ScreenEditTransaction
With the form frmEditTransaction
Which I've already stated its properties above.
But what happens is when I submit the changes of the new record I'm creating and I navigate back to the ScreenDetailTransaction my newly created Transaction record is not showing, instead the form shows the last Transaction record I clicked on before creating a new record.
How can I make the newly created transaction record show in the frmDetailTransaction form once it's been created and not the last transaction I viewed on that form?
Any help would be greatly appreciated. I'm sure I'm doing something wrong. It can't be this difficult. Thanks very much.
Garry