cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Gorilla_8
Post Prodigy
Post Prodigy

FORM DOES NOT UPDATE EVERY TIME THE USER EDITS


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!

1 ACCEPTED SOLUTION

Accepted Solutions
Gorilla_8
Post Prodigy
Post Prodigy

I found a solution, I put another card on my form and put this code before the submit:

Refresh(DataSourceName)

View solution in original post

17 REPLIES 17
VijayTailor
Resident Rockstar
Resident Rockstar

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



 

Gorilla_8
Post Prodigy
Post Prodigy

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

VijayTailor
Resident Rockstar
Resident Rockstar

@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

Gorilla_8
Post Prodigy
Post Prodigy

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

VijayTailor
Resident Rockstar
Resident Rockstar

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




Gorilla_8
Post Prodigy
Post Prodigy

@VijayTailor 

 

Sometimes I got the error, and after I try again and works, but some fields don't work!

Why??

VijayTailor
Resident Rockstar
Resident Rockstar

@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. 

Gorilla_8
Post Prodigy
Post Prodigy

@VijayTailor 

 

Some field, like choice columns don't the edit

Gorilla_8
Post Prodigy
Post Prodigy

@VijayTailor 

 

Like this? 

I got an error:

 

Gorilla_8_0-1613589538214.png

 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (57,152)