cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Super User
Super User

Re: Validation on Form Submission

@simms7400 

Ah yes...the pictures are worth a thousand words!!

 

So, I believe here is the issue you are seeing.  When you are creating a new item, ThisItem is blank for the CompoundCode.

So, what you need to do is grab the value that is in the AssetID and not the ThisItem (I think this is the Asset Alias field on your form?).

So, let's say that's a text control...then you would alter the formula to this:

If(
	CountRows(
         Filter(rdInvestments, CompoundCode=DataCardValuexx.Text && !(PR_Lead_Indication.Value="FALSE"))
	) >=1 && PR_Lead_Indication.Value="FALSE", Disabled, Edit
)

If it's a drop-down or some other place that the current CompoundCode is coming from, then just substitute that in the above formula.

 

This should work equally well on new and edits.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
simms7400
Level 8

Re: Validation on Form Submission

@RandyHayes 

 

ThisItem was the trick, I needed to switch per your suggestion.  However, it still wasn't behaving like I needed it to.

 

Therefore, a couple tweaks and this is what I arrived at and it works as expected:

 

If(InvestmentEditForm.Mode = New && CountRows(
	Filter(rdInvestments, CompoundCode=DataCardValue41.Text && PR_Lead_Indication.Value="TRUE")) >=1, Disabled, 
	CountRows(
	Filter(rdInvestments, CompoundCode=ThisItem.CompoundCode && !(PR_Lead_Indication.Value="FALSE"))) >=1 && PR_Lead_Indication.Value="FALSE", Disabled, 
	Edit
)

Thanks again, Randy!! Have a grea holiday weekend!

Super User
Super User

Re: Validation on Form Submission

@simms7400 

Ah I see, you needed to look at the other value as well in your statement.  Good deal!  Glad you got to a working point.

Have a great holiday weekend as well.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,127)