Hi,
I'm new one at PA. I'm building an app that controls my projects.
First screen I listed my projects (based on sharepoint list):
after clicking at the project, goes to 2nd screen:
in that screen i have some buttons on top (Novo = New; Editar = Edit). my question is about de button "Editar" or Edit.
If I click on it, my form goes to Display Mode edit and I can change whatever I want.
two buttons are shown on the botton of screen (Save and Cancel). So if I click on Save, it saves my edited form perfectly.
If I click again on Edit button, it doesn't show the data anymore.
here are some of my properties:
OnSelect in my gallery:
OnSelect in my Edit button:
OnSelect in my Save button:
What Am I doing wrong?
thaks.
Solved! Go to Solution.
Hi @Anonymous ,
Do you mean that if you click the edit button after you save the form, the form will display nothing?
The reason why you met this problem is that:
if you change the form's mode from view to edit, the form's lastsubmit item will be cleared.
So formname.LastSubmit actually represents blank value. If one edit form's Item is blank, it will display "no item to display".
The solution is: save the formname.LastSubmit as a variable after you submit the form. If you click that edit button, make the form display that variable.
I've made a similar test for your reference:
1)gallery's OnSelect:
EditForm(Form1);Set(mode,"edit")
2)add button's OnSelect:
NewForm(Form1)
3)form's Item:
If(mode="edit",Gallery1.Selected,mode="view"&&!IsBlank(Form1.LastSubmit),Form1.LastSubmit,mode="view"&&IsBlank(Form1.LastSubmit),item)
//if you click the edit button the first time, you will view the selected item.
If you click the save button, you will view the last submit item.
If you click the edit button again, the form's lastsubmit item will be blank. So you will view the variable item(which is the last submit item)
4)save button's OnSelect:
SubmitForm(Form1);ViewForm(Form1);Set(mode,"view");Set(item,Form1.LastSubmit)
5)edit button's OnSelect:
EditForm(Form1)
Best regards,
OnSuccess (Form) = ResetForm(Form)
where should i write this?
YourForm.OnSuccess
I forgot this, propieties ITEM on my form
Now, it goes to "Nothing" at first time I saved. Not worked.
What is in Default of Form property?
DefaultMode = View
GalleryiaProjectos is on a different screen?
try setting onselect of that gallery to Set(varItem, ThisItem)
Then in the Item change galleria.selected to varItem
Hi @Anonymous ,
Do you mean that if you click the edit button after you save the form, the form will display nothing?
The reason why you met this problem is that:
if you change the form's mode from view to edit, the form's lastsubmit item will be cleared.
So formname.LastSubmit actually represents blank value. If one edit form's Item is blank, it will display "no item to display".
The solution is: save the formname.LastSubmit as a variable after you submit the form. If you click that edit button, make the form display that variable.
I've made a similar test for your reference:
1)gallery's OnSelect:
EditForm(Form1);Set(mode,"edit")
2)add button's OnSelect:
NewForm(Form1)
3)form's Item:
If(mode="edit",Gallery1.Selected,mode="view"&&!IsBlank(Form1.LastSubmit),Form1.LastSubmit,mode="view"&&IsBlank(Form1.LastSubmit),item)
//if you click the edit button the first time, you will view the selected item.
If you click the save button, you will view the last submit item.
If you click the edit button again, the form's lastsubmit item will be blank. So you will view the variable item(which is the last submit item)
4)save button's OnSelect:
SubmitForm(Form1);ViewForm(Form1);Set(mode,"view");Set(item,Form1.LastSubmit)
5)edit button's OnSelect:
EditForm(Form1)
Best regards,
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
User | Count |
---|---|
182 | |
95 | |
66 | |
64 | |
60 |
User | Count |
---|---|
243 | |
163 | |
94 | |
84 | |
82 |