Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Problems with linked entries search

79 views
Skip to first unread message

Equand

unread,
Jul 7, 2017, 6:03:13 AM7/7/17
to mementodatabase
Hi,

I find it really annoying that you can't search by barcode to add an item as a linked entry.

How to reproduce:

Find an item with linked entry.
Press the looking glass icon to search for item.
On the selection screen press the barcode icon in the top menu.
Press search in dropdown and scan barcode off item.
Upon the item being found if you click on the item to be added as linked entry it is not added but you open it to edit/view.

Workaround:
Rather problematic, after barcode searching you have to return to initial search which was after pressing the looking glass icon.
Press the looking glass again (frustrating I know)
Press the last searched text entry.
Press the item and now it is added.

Best fix?
Please just make the barcode button to search items by barcode instead of dropdown this would cut one awkward press (difficult to press that Search dropdown)
Also please make the search by barcode similar to usual search so the item can be selected for linked entry instead of editing/viewing.

jorgetri...@gmail.com

unread,
Jul 17, 2017, 5:13:35 PM7/17/17
to mementodatabase
I've the same annoying behavior.

Richard Samson

unread,
Jul 18, 2017, 4:50:30 AM7/18/17
to mementodatabase
Yep same issue here.  I have a food diary in one table, a list of food items in another, ideally I'd like to barcode scan the items and have them added automatically to the list, but even having them add via a tap from the search results would help, at the moment the barcode search is pretty much useless for linked fields.  Thanks for the work around, that'll help out a lot.

Chris Tracey

unread,
Jul 19, 2017, 5:07:25 AM7/19/17
to mementodatabase
Hi there

Is it possible to tackle this through JavaScript.

I tried to work up a simple example. Taking Richard's example of the following two tables:

1) Food items - one row per item. This includes a barcode, name of item and maybe some other items.
2) Food diary - one row per item consumed.

If I understand Richard correctly he wants to search in the Food Items directory for a specific item. If he finds one he wants to find details in the Food diary?

To model this I've created two tables:

1) Barcode Master - equivalent to Food items
2) Barcode Junior - equivalent to the diary.

There is some code at the bottom of the email. You need to add this to a trigger script in Barcode Master i.e from the library list screen:

1) Click on three buttons on top right
2) Click on scripts
3) Click on the + sign on the bottom right
4) Choose trigger
5) You need to choose an event - choose 'Creating an entry'.
6) You need to choose a phase - choose 'Opening an edit entry card'
7) Paste in the code
8) You might need to change the permissions. So click on the shield button, click on available libraries and chose Barcode Junior.
9) Click on OK and save the trigger.


Now go to the library list screen. I click on the barcode simple at the top and I am given three options:

1) Add
2) Bulk Add
3) Search

I click on search and this prompts my scanner software to scan the barcode I am interested in. It then lists all items which have that barcode - as the master file has one record per item it should only find one item.

Then click on the item which takes you into the create an entry event. This runs the trigger and saves the item name to Barcode Junior. 

That's the idea, but there are a few buts:

1) This works on my Memento. Obviously it would need testing on other libraries.
2) At the moment it would save the entry each time you created a new record. Therefore you might need to create a prompt to ask people if they do actually want to save the item to the junior file.
3) It doesn't allow you to add in other fields to the junior file. There maybe a way to do this in JS.

Let me know if this is headed in the right direction. Happy to think about it some more, although I am still a relative JS newbie.

Chris

***************  Code ************************
message ('in barcode trigger');
var thisitem=entry().field("Item");
message (thisitem);
var ljun=libByName("Barcode Junior");
var ljunent=ljun.entries();
// message (ljun);
// message (ljunent);



// var addrecord=libByName("Filterhome");
var newentry= new Object();
newentry["Item"]=thisitem;
// newentry["Address"]=libent[ent].field("Address");
ljun.create(newentry);

Reply all
Reply to author
Forward
0 new messages