Hello members,
This seems pretty simple but unable to achieve the desired results.
Could you assist what's going wrong.
- Screen 1 is a homepage with a Button1 called NEW and Gallery1 with a list of items
- Screen 2 is a View Detail Screen. This has a button called CHANGE to modify a record.
- This is an EditForm on Screen 3
I want to change the caption of the title to "New Form" based on whether a user has arrived to Screen 3 via the NEW button from Screen 1
OR
set to "Edit Form" if user has arrived via the CHANGE button of Screen 2.
NEW Button has -> NewForm(EditForm1);Navigate(Screen3);
CHANGE button has -> EditForm(EditForm1);Navigate(Screen3);
On all cases I am getting the Form mode as Edit and never as New, hence unable to write a formula accordingly.
Please advise.
Thanks.
Solved! Go to Solution.
Ok i got it now, let me know if it works.
If(Editform1.Mode=FormMode.Edit;"edit";"new")
or..
If(Editform1.Mode=FormMode.Edit;"edit";If(Editform1.Mode=FormMode.New;"New";If(Editform1.Mode=FormMode.View;"View")))
New form and Edit form are actually the same thing.. It is read as edit.
When you write : If(Editform1.DisplayMode ="edit" , "EditForm, "NewForm") , it will always show editform,of course.
I can suggest to create a variable that activates when you click on that "New"button.
Hope it will help
Hello @Masino
Thanks for your reply.
If New form and Edit form are same how does it know whether to Add a new record or Edit an existing one using the same button while saving a Form?
NewForm and EditForm are exactly the same.
With newform you insert new data into a blank line ( if we think this way), and with editform you edit an existing line ( thats why you have to "select" what you have to edit).
UPDATE: OK , i got you now, FormMode... sorry, my mistake! I hope the solution below will help anyways ! 😉
My solution is to create a variable that becomes true when you click on the "new" button.
So your formula would be,
new button from screen1 : Onselect : set(xxx, true)
back from screen 3 ( or whatever you want) : set(xxx, false)
on the label text: If(xxx = true , "newForm", "editForm")
Hope this will help you
Gotcha...
If(Editform1.Mode ="edit" , "EditForm, "NewForm")
If(Editform1.Mode.Edit = true , "EditForm, "NewForm")
😉
@Masino , I had compared using the .Mode prior to posting here and both the above statements are throwing the incompatible comparison error (enum versus text).
I had the variable option in mind, but I had read that the Form modes automatically change to New or Edit depending on whether NewForm or EditForm are called respectively.
Any solutions other than variable, please share.
have you tried to use
If(EditForm1.Mode.Edit = true , "EditForm, "NewForm")
with the big F?
As i can see in your image it has not been recognized ( you know, the colour of the function) .
As you can see i don't get this error.....
If i got any solution i'll write here
Typo on my side with the F, but still shows the incompatibility in comparison.
It is giving New Form in both the cases (New or Edit)
The yellow mark that is seen in your screenshot too gives the below.
Ok i got it now, let me know if it works.
If(Editform1.Mode=FormMode.Edit;"edit";"new")
or..
If(Editform1.Mode=FormMode.Edit;"edit";If(Editform1.Mode=FormMode.New;"New";If(Editform1.Mode=FormMode.View;"View")))
If(Editform1.Mode=FormMode.Edit;"edit";"new")
is working as expected.
I will share another option for anyone landing on this thread
If(Value(Editform1.Mode) = 0 ;"edit";"new")
0 is for Edit
1 is New
2 is View
Thanks :).
User | Count |
---|---|
263 | |
110 | |
98 | |
55 | |
40 |