I have a variable called "varMode" and it contains three types:
"varMode = New" = FormMode.New
"varMode = Edit" = FormMode.Edit
"varMode = View" = FormMode.View
And in the item property of the form:
MyGalleryName.Selected
What is happening:
If I edit the item once it updates, however if I am going to update and update (save the form again) it does not update the form.
Here my code in the property "OnSelect":
If(
FormAnaliseNew.Valid;
Patch(
FichaDeAnalise;
{ID: GaleriaAnálise.Selected.ID};
FormAnaliseNew.Updates
);;
Set(
varID;
Last(FichaDeAnalise).ID
);;
Set(
varPopSalvar;
false
);;
/*SubmitForm(FormSalvarUltimoStatusEStatusAtual);;*/
Notify(
"As informações da análise foram salvas";
NotificationType.Success
);;
ResetForm(FormSalvarUltimoStatusEStatusAtual);;
Navigate(ANÁLISE);
Notify(
"Não foi possível salvar. As informações “Área Demandante” e “Projeto (nome sugerido) são de preenchimento obrigatório!";
NotificationType.Error
);;
UpdateContext({varBorder: true});;
ResetForm(FormSalvarUltimoStatusEStatusAtual)
)
The error is on this part:
Patch(
FichaDeAnalise;
{ID: GaleriaAnálise.Selected.ID};
FormAnaliseNew.Updates
)
I don't know how to fix it! I tried every post here on community...
Thank you very much for the help!
Solved! Go to Solution.
I found a solution, I put another card on my form and put this code before the submit:
Refresh(DataSourceName)
Hi @Gorilla_8 ,
Once you Update the Data using From Gallery will Update. So instead of Giving direct Gallery reference, you can set the global variable on the ONSelect of Gallary Record.
and use the same variable for the Form Item Property.
Set(EditThisItem,ThisItem);
in From Item Property Pass this variable inside the Item Property - EditThisItem.
Hope this will help you to resolve your Issue.
Thanks
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."-Vijay
Hi @VijayTailor
I already got the variable
To edit the item on gallery I put this: Set(varEditar;ThisItem)
To see item: Set(varConsultar;ThisItem)
And I keep the error on "Patch"
On my form item I put the variable "varEdit", and I got an error on patch
@Gorilla_8
I did not understand, one thing if you are using form then why you using the Patch function.
Can you please elaborate on your issue with your proper details?
Thanks
Because the function "SubmitForm" doesn't work
When I edit the same item several times it doesn't update and I have this error:
I just want the user to be able to edit and save the item over and over again
There are conflicts with the server changes. Reload. Server response: Failed AnalysisFile: incompatible ETG. clientRequestId: 692e79cc-5a92-4582-99a2-154c476609ca serviceRequestId: 692e79cc-5a92-4582-99a2-154c476609ca
Hi @Gorilla_8 ,
you can try the below approach without patch but with submit the form.
Suppose "varEdit" global variable set for the Form Item.
Now you Update the Value using Submit Form but you not updated the variable "varEdit" and again you submitting the data its throwing an error.
So for resolving this error using Submit form function and Set the OnSuccess Property of the Form and Update the variable value like below.
Set(varEdit,FormName.LastSubmitted) So Now When even every you update the form even How may time you update the Form, Hope you will not get this error.
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."-Vijay
Sometimes I got the error, and after I try again and works, but some fields don't work!
Why??
@Gorilla_8
Hope you will Not Get this error if you use the above approach.
One addon the above approach.
For Save Button Set DisplayMode Property. Like FormName.Update =true,DIsplayMode.Diabled,DisplayMode.Edit)
This will ensure you like if your Form Modified then only Save Button is enabled for Save the Data.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
208 | |
48 | |
43 | |
41 | |
36 |
User | Count |
---|---|
291 | |
83 | |
80 | |
80 | |
76 |