cancel
Showing results for 
Search instead for 
Did you mean: 

Agentry app - Find in collections

Former Member
0 Kudos

Hi all

I try to understand finding in Agentry collections.

I have a colllection ":>"MeanObjCollection" Property" that is bind to the List View in the Detail screen DetailScreenList_MeanObjCollection

So I can see this collection on the screen at run-time

I have Barcode Scan field with Scan button (not visible in Windows client, but this is not important at the moment).

I want to perform search in the MeanObjCollection by value from Barcode Scan field.

As in the first experiment I want to be positioned on the last record of MeanObjCollection

So I write next Action for button "Find Scaned Value"

:>Main Screen Set>"DetailScreenList_MeanObjCollection" Detail Screen>Current Object>"MeanObjCollection" Property>Last Object

I expect that this action must move current record on the screen to the last record.

But Button press visually do nothing.


2016/09/20 18:22:38.248: Opening log file

2016/09/20 18:22:38.248: + Module=FlightBookingModule

2016/09/20 18:22:38.248:   + Action=SelectLastMeanIn_DetailScreenList_MeanObjCollection

2016/09/20 18:22:38.248:     (112) Status: ActionNoOperation - CanExecute check returned ActionNoOperation for all steps.

Although the log says that the action was carried out.

What is wrong with me?

Accepted Solutions (1)

Accepted Solutions (1)

jason_latko
Advisor
Advisor
0 Kudos

Konstantin,

To select a row progromatically, you need to do a list selection step in an action.  You can tie that action to your push button.  The step should include the screenset, screen, list control and then logic for the row to select.  You can include logic based on the scanned value in a rule.

Jason Latko - Senior Product Developer at SAP

Former Member
0 Kudos

Hello Jason

Thank you for answer.

I created List Selected Step with simple Setting "Select Ruws" = 'Next Row'

It works.

Now I want to select row that have corresponding BarCode in ScreenField = ":>Main Screen Set>"DetailScreenList_MeanObjCollection" Detail Screen>"ScanCodeField" Field"

So I Set "Select Rows" to 'By Rule'

and created Rule with EQSTR funcion

and parameters

String 1 : ???

String 2 : :>Main Screen Set>"DetailScreenList_MeanObjCollection" Detail Screen>"ScanCodeField" Field


I can select for the first parameter where i want to put "Barcode" field from "ListOfBarcodes" "List View".

How can I pass "ListOfBarcodes" "List View" to the the Rule so It could be visible on the propeties page of the Rule.


jason_latko
Advisor
Advisor
0 Kudos

Konstantin,

For the other EQSTR parameter, use the actual object name reference that your list screen displays, so if it is a list of "TEST" objects, use the property browser to find the "TEST" object under "Other Objects", and pick the property you want to search: "TEST" Object -> "Search" property.  You don't need to reference the list itself, just the object that the list contains.  Agentry will figure the rest out for you.

Jason Latko - Senior Product Developer at SAP

Former Member
0 Kudos

Hello Jason

Yes, it works.

I set String 1 as :>"MeanObj" Object>"Ean11" Property

and String 2 :>Main Screen Set>"DetailScreenList_MeanObjCollection" Detail Screen>"ScanCodeField" Field

and List View jumps to the found record.

Everything works except for one thing

If code is not found then nothing happens.

I want to show dialog that code is not found.

I know how to show dialogs - use Message Step

But I don't see where to put it.

Could you give a tip.

jason_latko
Advisor
Advisor
0 Kudos

Konstantin,

Set up a sub-action step before the list selection view that tests for the missing case using an execute rule.  The sub-action type is "Execute once if rule is true".  Create an execute rule called "ExecuteIfMissingRow".  It should look like this:

NOT

     TYPE

          Whatever Collection -> First Object Where Rule "FindRow" is True

TYPE is a PROPERTY function that acts as a WHERE EXISTS.  You can use TYPE to search for any object path.  If the path is found, TYPE will return TRUE, else FALSE.  So the whatever collection should be the collection that is displayed on your list.  FindRow is the same rule you wrote to do the list selection.  The execute rule will check to see if there is a matching row in the collection and either return TRUE or FALSE.  If FALSE is returned because there is no row, then the NOT will flip it to TRUE and the sub-action will run.  If there is a match, the execute rule will return FALSE and the sub-action will not run.  Create another action called "ShowMissingMessage" that pops your dialog and tie it to the sub-action step.  Now the message will pop up when there is no match, then the list selection step will run but will not find a row to select.  Problem solved.

Jason Latko - Senior Product Developer at SAP

Answers (0)