cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ms-PowerRanger2
Helper I
Helper 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.

View solution in original post

Ms-PowerRanger2
Helper I
Helper 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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,139)