cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Super User
Super User

SQL Azure Database issues editing existing record

I have an edit form which I am opening by clicking a 'Next Arrow' from a Gallery (galOrderDetail) bound to the same data source ('[Order].[OrderDetail]').

The edit form's Item property is set to galOrderDetail.Selected. When I open the form it shows all the correct data for the currently selected item in galOrderDetail as expected.

I then change the value in field 'Quantity'. There is a field 'OrderLineTotal' for which the default is the Quantity multiplied by the item price. The calculated value appears correctly on the form.

DataCardValueOrderQuantityEdit * LookUp(LocalMenuItem, MenuItemID = galOrderedItems.Selected.MenuItemID, MenuItemPrice)

The first issue that appeared was that the 'OrderLineTotal' field was updating in the database, but the Quantity field was not?!?

I then created a new screen in case I had accidentally modified some setting/formula.

The new screen would update both the Quantity and OrderLineTotal as expected the first time such an edit was made. Subsequent edits resulted in the error 'An entry is required or has an invalid entry'.

So I rebuilt the screen again. This time, sometimes there is an update, sometimes there is an error, sometimes there is no error but no data is changed. Ahhh! Pulling my hair out.

Any ideas what could be the problem? Is this something I'm doing wrong or is the SQL Azure DB connector just really buggy and unreliable? 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: SQL Azure Database issues editing existing record

So, just to close this off - I never figured out what the problem was. Just kept on rebuilding the form, as far as I am aware, exactly the same as before (I copied formulas from the old screen into notepad and then pasted them into the new screen) and for the moment, it is working.

 

I will raise separate post for the other issue I am now experiencing.

7 REPLIES 7
mx
Level 8

Re: SQL Azure Database issues editing existing record

This could be a longshot, but if you have a TimeStamp data type field in your table, try adding one.

In general, I've seen this solve an assortment of problems.

DatabaseMX ('mx')
Microsoft Access MVP
Super User
Super User

Re: SQL Azure Database issues editing existing record

Thanks @mx but I don't think that is the issue this time.

 

On further investigation, I think the issue is that to make data entry easier, I added a slider control to try to vary the number in the Quantity field. I want data entry to be very fast, and bringing up the keyboard on a mobile device and tapping in numbers is not quick.

 

I had set the default value of the Slider to the quantity of the selected item in the gallery. I then set the default of the Quantity data card to be the value of the Slider. While everything appears to be OK when viewed on the form, there must be something in this setup that can prevent saving the changes consistently.

 

I notice there is a default property for both the DataCard and the DataCardValue objects. Not sure which I should set to the value of the slider. I'll have to play a bit more and see if I can get the slider working properly for editing the Quantity of the existing record.

Super User
Super User

Re: SQL Azure Database issues editing existing record

Actually, scratch that last reply.

 

Initially, after removing the link to the slider everything worked fine - I tested many times with many sample records. Then I closed the App and just now opened again and... the error is back again Smiley Sad

 

Very, very frustrating. This is just a simple edit form now, can't understand why something so simple won't work reliably.

Super User
Super User

Re: SQL Azure Database issues editing existing record

Rebuilt the form and now it is working again even with the slider...

 

But now, in my OrderHeader Gallery, when I click to go to the OrderHeader Edit screen, upon clicking (say) customer1, that customer appears in the Edit screen. Then I go back to the Gallery and click on Customer2. In the Edit screen Customer2 appears for a second, then it goes back to Customer1 again.

 

Every time I think I am making progress, I get strange behaviors in another part of the app and have to delete several screens and start over, recreating the screen exactly as it was before but hoping to that it goes back to the correct behavior.

 

Is it just me? Am I going mad? Or are other people encountering strange and inconsistent behavior?

Super User
Super User

Re: SQL Azure Database issues editing existing record

So, just to close this off - I never figured out what the problem was. Just kept on rebuilding the form, as far as I am aware, exactly the same as before (I copied formulas from the old screen into notepad and then pasted them into the new screen) and for the moment, it is working.

 

I will raise separate post for the other issue I am now experiencing.

mx
Level 8

Re: SQL Azure Database issues editing existing record

ok

DatabaseMX ('mx')
Microsoft Access MVP
Super User
Super User

Re: SQL Azure Database issues editing existing record

This is the other issue I'm experiencing: https://powerusers.microsoft.com/t5/PowerApps-Forum/Bug-Selecting-a-record-in-Gallery-takes-you-to-t...

 

I believe this is a bug as I can consistently reproduce the issue (clicking in a gallery before it has finished refreshing will display the correct record in related controls, then after a second or two switches to the wrong record in those controls).