cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

patching issue requires to push the button twice to update the data in data base

Hi,
I am facing a problem with patch.
while updating the data in the data base in single click ,it didn't work
But after clicking twice it is updating the database.

Please suggest.....

5 REPLIES 5
Phydax
Frequent Visitor

Hi @Anonymous ,

we need more info to help you, could you please at least send the code of the OnSelect of your button? 


Anonymous
Not applicable

Hi,
Below is the code for Patch function:

 

Patch(
'[dbo].[Requests]',
First(
Filter(
'[dbo].[Requests]',
RequestID = varRequestID
)
),
{
ApprovedBy: varUser,
RequestStatus: varAction,
ResponseDate: Now(),
ResponseComments: varComment

}
);

In the above code I am trying to update the data in the Request table using Patch
But on the first click this particular column "RequestStatus" is not being pushed and on the second click its getting updated.
So my question is why its is getting pushed on the second click and not on the first click.

Note: The column is getting updated twice after the second click but not changed in the first click.

Thanks in advance...

Phydax
Frequent Visitor

Where/when is varAction initialized/modified?

Before you click, go to the top left of your screen and click views, then variable.
What is the value of varAction before you click, after you click, and after the second click?

Anonymous
Not applicable

Hi Phydax,

The patch function is running on select of a button which in there on a popup.
To generate that pop up we are clicking on a button and on click of that button we are even passing the value of "varAction".
The value we are passing is "Approved" . I have checked in the "View" and it is passing the value as "Approved" but its not being updated in the database.
where as other values are being updated in the database.

 

Thanks in advance...

Hi @Anonymous 

 

Can you try to check if this double click behaviour occurs in a different browser as well? If not, then please clear the cache of the browser and login again. Also, make sure that the browser is in its latest version.

Regarding the field not getting updated, what is the type of field in the datasource and what is the value that you are passing?

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

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

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (15,876)