RIA/Android Column update nightmare #ria #android


Natasa Panic
 

Hi all,

This is my first post in this group. I'm new to Magic XPA (3.2) and i'm trying to develop simple android app with only two screens:
1. Enter PIN code screen (where user enters 4 digit PIN code)
2. Main menu screen

All PIN codes are stored in "MobileUsers" table:
1. ID (Autoincrement)
2. PIN (Numeric 4)
3. Username (Unicode)
4. Logged (Logical, db default 'false')

When user opens the application and type in PIN code app will check if there is a user with that PIN code and IT SHOULD update the column "Logged" with TRUE and then open the main menu.

How to update this column right after the user is approved? Or when main menu is showed. The value stays "FALSE" until i close the app completely, and it driving me crazy. I tried so many things and i'm not sure that i understand the xpa for mobile development principles.

Thank you so much in advance,
Natasa Panic


Andy Jerison
 

Hi Natasa,

Welcome to Magic and to the group. :) 

You might want to copy this program, change the copy to an Online (i.e., desktop deployment) task using the memory database, and work with that to help you understand how the engine works. You'll be working in a simpler environment where you can easily monitor what happens both in Magic and in the database.

Your program could be failing to update the database for two reasons:
1) It doesn't leave the row, or
2) It leaves the row but the update is wrapped in a transaction which isn't committed.



On Sat, Mar 17, 2018 at 3:21 PM, Natasa Panic <natasa.panic.970@...> wrote:
Hi all,

This is my first post in this group. I'm new to Magic XPA (3.2) and i'm trying to develop simple android app with only two screens:
1. Enter PIN code screen (where user enters 4 digit PIN code)
2. Main menu screen

All PIN codes are stored in "MobileUsers" table:
1. ID (Autoincrement)
2. PIN (Numeric 4)
3. Username (Unicode)
4. Logged (Logical, db default 'false')

When user opens the application and type in PIN code app will check if there is a user with that PIN code and IT SHOULD update the column "Logged" with TRUE and then open the main menu.

How to update this column right after the user is approved? Or when main menu is showed. The value stays "FALSE" until i close the app completely, and it driving me crazy. I tried so many things and i'm not sure that i understand the xpa for mobile development principles.

Thank you so much in advance,
Natasa Panic



Natasa Panic
 

Thank you Andy.

But... since all Mobile forms are "Modal" only that means it is not possible to update the row until the app is closed. Or i'm missing something.

Of course, this is very simple to do in desktop program, but it is frustrating on Android since XPA is stacking every new form on the top of the previous one.

Is there any solution for this?


Tim Downie
 

hi - make sure the task transaction is record level - this way the data is saved when user leaves the record and not the task




From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of Natasa Panic <natasa.panic.970@...>
Sent: Sunday, 18 March 2018 9:58 PM
To: main@magicu-l.groups.io
Subject: Re: [magicu-l] RIA/Android Column update nightmare #android #ria
 
Thank you Andy.

But... since all Mobile forms are "Modal" only that means it is not possible to update the row until the app is closed. Or i'm missing something.

Of course, this is very simple to do in desktop program, but it is frustrating on Android since XPA is stacking every new form on the top of the previous one.

Is there any solution for this?