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

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.
Highlighted
Post Prodigy
Post Prodigy

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!

Highlighted
Super User III
Super User III

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
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,603)