cancel
Showing results for 
Search instead for 
Did you mean: 

Agentry - How to store scan data locally?

Former Member
0 Kudos

Hello Agentry experts, I have a design question I was hoping experienced Agentry application developers could help me answer.

I need to build an app that will pull data from a back end SAP system to the device. Then I want to be able to scan a barcode that will represent an inventory ID. If the item is found, I want to store that scanned ID in an array or local table. Then when the user is ready they can do a transmit that will send those values to a web service that will process the values on the back end.

If the ID is NOT found, I want to store it in a separate array or local table and then make another web service call and pass those values for processing by the back end system.

So I presume that I would accomplish this in steps and possibly by creating some rules and actions that would kick off this process. What I'm not clear on is how I can save those values locally and then clear them once the web service has been successfully called.

Can someone describe how this can be done in Agentry and point me to the relevant areas of the documentation so that I can learn how to set this up?

Thanks,
Dave

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

How is the local current barcode ID's store in the client?

If you have them in a object you can scan on a list view or list tile view and if the ID matches the client will call:

  • Single Match Action: Specifies what action is executed when a scanned barcode value uniquely matches an object in the list tile view. The target of the action will always be the object instance found to match. This attribute will be disabled if the Use Edit Row attribute is set.

If not found:

  • No Match Action: Specifies what action is executed when the scan filter criteria does not match any records in the list. The target of the action is the parent object to the collection property displayed by the list tile view. This attribute will be disabled if the Use Add Row attribute is set.

SyBooks Online 

Answers (1)

Answers (1)

jason_latko
Active Contributor
0 Kudos

Dave,

Pretty easy to handle your requirements:

Create a new object called ScanValue.  Add any properties, with a minimum of a string called ScanKey.  Add a collection of ScanValue objects to the Main Object.  Call this ScanValues

Create a screenset with a list screen.  The list should point to the ScanValues collection for display.  Enable the screen for scanning.

This action has a transaction in it called ScanValueAdd.  The transaction should be added under the ScanValue object.  You only need a single property, a string tied to the ScanKey of the object.  To set the value, use rule before data entry as the initial value type.  Create a rule called InitialValueScanKey that has a single entry in it: LASTSCANVALUE function from property functions.  This function returns the last value returned by the scanner.

Create a new action called ScanValueAdd.  In this action, add your ScanValueAdd transaction followed by an Apply step.

For the No Match Action on the list, point to your ScanValueAdd action.  This will add the scanned value to the list if it is not already there.

To send these to the backend, you can do this in a couple different ways:

Tie an update step to the ScanValueAdd transaction to pass them up individually.  Set the act on object to "Delete" to remove the row after it has been transmitted.

2nd option is to bundle them together by running a final transaction at transmit time that sends up the entire collection in a single transaction.  I wouldn't recommend this approach if the data volume will be high (hundreds or thousands of rows).

Jason Latko - Senior Product Developer at SAP

Former Member
0 Kudos

Thank you Jason and Stephen for your responses. I'm still pretty new to Agentry so it will take me a while to digest this information but it is really helpful and will save me a lot of time.

I neglected to mention in my original post that the app needs to work in offline mode as network connectivity isn't assured at the site of the scan. Ideally the client would like three modes of operation:

1. Online - User scans asset and it verifies that it exists in the backend system, or that it doesn't. The backend system handles all exceptions, we just want to notify the user that a match wasn't found.

2. Offline - User pulls down their universe of assets to the device while connected and can then go offline and scan the assets. Again they will be notified if a match is found or not, but the scan results don't get sent to the backend until they go back online.

3. Offline - User just scans barcodes to their heart's content, we don't even need backend data on the device. Then they submit the scan values to the backend when they go online. The backend handles all of the processing and the mobile user doesn't need to know what matched and what didn't.

So I'm assuming that the advice provided above is still applicable for these scenarios. We still haven't decided which scenario(s) will be implemented. Based on your knowledge is any one of these faster and easier to implement?

Thanks,
Dave

Former Member
0 Kudos

Jason you are right. It looks pretty straightforward thanks to your great step by step instructions. I'll see if I can get this working tomorrow and let you know how it goes.

Thanks again for the step by step instructions. It looks like an elegant solution.

Dave