How to manage simultaneous use

Hello,
i have an application to manage orders.
More then one person can use the app with the same right.
If two people have the app opened, they can do the same thing in the same time.
The main issue is if they go into an item detail view trying to create an order for it.

I have build a simple check to hide the action if it is supposed that you shouldnโ€™t press.
But if you are already in, without sync, this is not enough to prevent occasionally misunderstanding

thanks

0 21 1,364
21 REPLIES 21

Iโ€™m afraid you canโ€™t avoid like that because your users can have the same data with their devices. Though you can check for example with a scheduled report if duplicate orders are createdโ€ฆ but that will happen later, not when they are filling/saving the form.

Thanks

Doesnโ€™t exist some tricky way neither? Maybe not a real solution but something that at least can help?
Prevent duplicate order open for the same ID? Like an error when the second user press โ€œsaveโ€

Yes, one possible workaround is you create your own ID formula which prevent the duplicate entry.

Actually my ID is UNIQUEID() of course to be unique.
So i have
[ORDER ID]=UNIQUEID
[ITEM Serial Number] that is unique in his database but obviously not in the order table

Can you elaborate your tables with names and relationship between them? Who is parent and who is child etc.

Hi,
A potential workaround is you could add an extra logical column โ€˜in_useโ€™ against one or more parent tables as appropriate.
Then create an action that when your users view / update etc (force the trigger) the logical field in use becomes true, and false when they create the new record (or discard changes).
From there just add the check โ€œin use = falseโ€ criteria to potential double ups
I.e. record it against the customer and/or job to filter down to the targeted transaction scenario

Hope it helps
Edit: if itโ€™s in use make the data read only with a pop up of why

Hey! How to force the trigger when a record is being viewed?

Table1: database of truck
Table2: order(trip of these truck).

In table 2 the key is an uniqueID but the same truck can do a lot of orders, not just 2 in the same time of course. If i create an order still OPEN, you cannot create another order with the same truck (the action โ€œcreate orderโ€ is not visibile anymore at this point to prevent human mistake).
But my colleagues can create in the same time another order because they donโ€™t see mine yet, if iโ€™m still in the form. They need to wait some second that i save and then manually sync to update.

One method could be 1 action โ€œreserve truckโ€ (set available to FALSE), then open the order. So the second user canโ€™t opens an order on the same truck. But will this action effects my colleagues app or still we have the sync issue?

Hi Mark,
Create an audit table to log intermediary transactions
Log the order id, user logging the order and the truck here as a record with the logical โ€˜in_useโ€™ column.

Then have the action check the audit log on navigating between viewing the customer and raising an order forms if the value is true/false.

Hope it helps
Edit: then set the in use value to false once they log the order.
Also you donโ€™t need to stop them entering an order, you can then notify them like โ€˜note: Mark is currently raising a similar orderโ€™. Prompt staff conversation of whether itโ€™s a duplicate.

Thanks for the help;
itโ€™s a bit difficult to me to understand what you are trying to suggest

Hi Mark,
That helps, thanks.
Iโ€™ll try to be clearer with what Iโ€™m proposing.

Correct me if Iโ€™m mistaken:
You need to add a check between when users are opening a blank order that no other โ€˜blankโ€™ orders are currently being generated for that date + truck.
We can do this by recording a temporary transaction at the time they click to start a new order, as followsโ€ฆ

Have them input the truck id and date for order firstly, and then navigate them through to a form for the rest of the details.
When they navigate have those values saved to an audit table, with a unique audit id and โ€˜pendingโ€™ status.

Back to the order itself, have the audit values we got previously added to the form and also save the audit id to the order record to delete it later.

Now when the next user tries to press the same button the app stops them by looking at the audit log and finding a pending status for that truck AND date.
Seek audit_table FOR {truck} + {date} & โ€˜status=pendingโ€™
(Example expression)

Then once the pending order is lodged by the first user they also change the status to โ€˜doneโ€™, or even just delete the audit record.

Please think about whether you want that second user to be unable to log the order because itโ€™s not feasible to your business, or if youโ€™d rather empower them to be aware of the first users inbound order so they can discuss it as a team (maybe the truck can make two nearby orders).
Edit: On second thoughts I recommend deleting the audit record once they log their order, keep your data slim for faster processing.

@Mark_11

The suggestion from @recei_Plumber is valid as well, I believe.

The beauty of Appsheet is there are bunch of workaround to do the same stuffs.

It is upto your choice, @Mark_11

The solution of @recei_Plumber is kinda fascinating but also very tricky because of many cases possible in my company (some truck can have more than one order per day, some other not and itโ€™s totally random).
Also is not a matter of life and death at the moment, i have prioritisation based on cost-effectiveness.so maybe in the future i would try something like that and i would ask more about this. Thanks a lot.

For the solution of @tsuji_koichi my app already has all the Sync things enabled; the problem is we work 24/7 with the app opened, so we donโ€™t re-open the app

Sure, then only workaround I come up is the one I explained, i.e. the user change the view, then app starts to sync. Thats all from myself.

Hi Mark,
Glad you found some use to my solution.

The solution is really just an example of the SYSTEM you can use to resolve the issue, because no one knows the VARIABLES of your business better than you would.

I suggest you map out what criteria you need the audit log to capture for it to be effective, then add them.

Such as now I would also have the first user log the estimated time value (hours),or the allocated delivery times to the audit log before opening the blank form.

Now the audit log is asking whether the next usersโ€™ order time clashes with a โ€˜pendingโ€™ order .

When youโ€™re mapping out the variables I suggest you think about IF AND OR phrases.
These sorts of operational issues can usually be boiled down to such expressions.

Final note
I would set this up now Mark, even if itโ€™s imperfect.
But instead of stopping an order just notify the second user of a potential clash.

The team conversations this creates will really really help you later on to identify define your variables

Before we go forward, could you explain a bit what is your own โ€œdefinitionโ€ of duplicated orders?
I understand there is multiple unique trucks in table 1, that stands as parent. And then each distinct truck should be able to have multiple orders. In this context, what is duplicated order for you?

I mean, two order โ€œopenโ€ at the same time.
One truck canโ€™t go in two different place. Has to go in one city, then go back, close order. The day after can go in another city with another order.
You donโ€™t have the action visible โ€œcreate orderโ€ if one order is ON GOING already.
You can circumvent this rule if you create the order from another computer without sync, because โ€œyourโ€ app is not update in real time and you can see this truck still in the park lot.

My understanding based on your comment.

So in case a truck have One pending (open) order, user is unable to add new order AT ALL, unless he close this order first.

Once the order is closed, meaning there is no order with OPEN status, then you can add new order to this particular truck?

Is so, workaround is fairly easy.

Yes, thatโ€™s it and i already have a way to prevent this.
valid_if on the action so you donโ€™t se the action; but it works only if you have the app synced

Sure.

To make sure the app is synced when the user access to it, first safe guard is to set the app to sync โ€œon starting appโ€ all the time.

Additional safe guard should be using deeplink so that the app start to sync when the user change the view from A to B.

On this article, you can find how to construct " Manually Constructing Deep Links". Give only option to user to change the views from A to B by using action you generated which is connected with Deeplink expression, which fire the SYNC all the time.

Appsheet is connecting to database, but they are not REALTIME database.

This should be possible workaround I could come up with.

Top Labels in this Space