cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ms-PowerRanger2
Advocate I
Advocate I

How do you check if your adding a new record or if editing an existing record when in an edit screen?

Is there a way to check if when you navigate to the edit screen if you are entering new info to add a record for the first time or if you are editing an existing record?  I need to have a condition that checks if the user is adding a new record when navigating to the edit screen.

1 ACCEPTED SOLUTION

Accepted Solutions
BCLS776
Super User
Super User

There are a couple of interpretations of your question:

  1. You can check to see which mode the form is in. FormMode.Edit indicates the form is prepped to update an existing record. FormMode.New indicates it is ready to build a new record.
  2. If you are trying to ascertain if a record exists already, a good condition to use is a Filter() or LookUp() to try to search for the existence of the record. If no record is found, make sure your form is in FormMode.New and submit it.

Hope that helps,

Bryan

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

View solution in original post

2 REPLIES 2
BCLS776
Super User
Super User

There are a couple of interpretations of your question:

  1. You can check to see which mode the form is in. FormMode.Edit indicates the form is prepped to update an existing record. FormMode.New indicates it is ready to build a new record.
  2. If you are trying to ascertain if a record exists already, a good condition to use is a Filter() or LookUp() to try to search for the existence of the record. If no record is found, make sure your form is in FormMode.New and submit it.

Hope that helps,

Bryan

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.
Ms-PowerRanger2
Advocate I
Advocate I

Thank You for the fast response.  Response #1 was what helped me.  I needed to check if (MyForm1.Mode=New).


Best Regards,

Renee

Helpful resources

Announcements
Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

<
Users online (2,617)