I am developing an app in Teams power app
I am trying to use the below code on the default value of edit form field by this code,
It works fine and bring the correct result, But keep value applied all the time. even in the other records. Till it is closed.
BUT I want to value to be brought only if the form is in NEW mode. I mean while entering the new record
tried by FormName.FormMode check, but not work.
Please guide a correct way to approach the same formula for the requirment
@MIA27 Try this,
If(Form1.Mode=1,(First(Sort(TblSvcHistories, LineNo, SortOrder.Descending)).LineNo)+1,Parent.Default)
The code has not error, but the result is not required.
For new it bring the calculation as required,
But when the edit form is reset, or on the previous any old record, then record field value is blank, which it should not be.
Requirement is if new then fetch the calculation, for rest no need, it to be remained as it,
pls. check my below images and advise
Hi @MIA27 Try this code in Default,
If(Form1.Mode=1,(First(Sort(TblSvcHistories, LineNo, SortOrder.Descending)).LineNo)+1)
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional