Skip to Content

Agentry: Update rule to count subset of a collection based on TileList display

Hi Agentry Experts.

I am having a challenge that I cannot overcome in Agentry.

In Inventory Manager 4.2 you can download Reservations from the backend via a fetch, that will populate the Issues (object GoodsMovementDocument) collection of the MainObject.

The Object GoodsMovementDocument has two sub collections: Items of object Component and Issues of object MaterialDocumentItem.

The Screen Set IssueView is used to display TileLists for the Items and Issues collection in the right side of the screen, when the Issues screen of the MainScreen is displayed.

Each item in the Items collection is displayed via Screen Set: IssueComponentTile (which only has one screen: IssueComponentTile_iPhone ).

Now to the problem:

From the IssueComponentTile_iPhone screen I want to count elements in the collections Items and Issues of the current Component displayed in the TileList, and display it via an Update rule of a field in the Tile Screen. This works fine for the Issues collection but not for the Items collection. Please note that the Items collection is the one being displayed in the TileList, and I think this is the reason why it is not working. It seems Agentry cannot correctly determine the where clause, when it is regarding the same collection as the one being displayed.

The above rule is working for the Issues collection. Here the properties "material", "plant" and "storageLocation" refer to the fields of the Issues collection. The "Component" Object>fields are referencing the values of the corresponding fields of the current displayed object of the Component object in the TileList and the rule works as expected.

I have then tried to create a test (update) rule for another field, where I just want to display the number of entries in the (same) Items collection as is being displayed in the TileList.

The first example always evaluates to true in the include criteria, it seems that Agentry considers both references to be the same. Hence the count is set to the total number of entries in the Items collection.

Then to make a clear distinction between the reference to the field of the evaluated collection and the compare value, I have created the screen field ZZTestMaterial, where the material value is stored (confirmed on the screen). But this always evaluates to false, and hence I get the value 0 for the count.

I simply cannot get it to count the collection using the include criteria as needed.

Can somebody help please ?


Søren Hansen

testrule.png (24.5 kB)
Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Oct 31, 2016 at 03:00 PM


    Hi. I will try to give you the basic definition of Screen Design with respect to a Detail screen. Hopefully this can shed some light.
    A tile is a type of Detail Screen Field on a screen.

    In theory you can have different edit types.

    You stated this: "The Screen Set IssueView is used to display TileLists for the Items and Issues collection in the right side of the screen, when the Issues screen of the MainScreen is displayed."

    So in theory you have 2 different Detail Screen Fields (one for Items and one for Issues - Not sure if I read your comments above correctly)

    Now here is the definition (From manual):

    ~~~~~~~~~~~Start Definition~~~~~~~~~~~~~~

    A field (1 Detail Screen Field) definition can target a property within the definition it displays. The value of that property is displayed to the user and, for transaction and fetch screens, the user may be able to edit that value. The value of the field is assigned to the property when the user advances the wizard past that screen, for example, when clicking a Next button or Finish button.

    The field may also target other definitions within the application. If the target of a field is not a property definition, the value of the field is not copied to that definition. It uses it as a data source for the value to display. You can select these targets using the target browser, and can include other fields on the current screen or other screens within the same screen set.

    When the target is another screen field that is one of the edit types for displaying complex tables, you can select a complex table record field from the currently selected record in that target screen field. The target for a screen field can also include a field on screens in other screen sets, provided those screen sets currently exist on the Agentry Client, but are hidden from view due to the focus being on the current screen.

    Fields can have their displayed value set through an update rule. These fields can still target a property, normally for transactions and fetches, in which the value of the field as set by the update rule is the value assigned to the property when the user advances the wizard. Normally, you would not use this method when displaying an object.

    Fields may also be hidden and/or disabled via rule evaluation. A hidden field is not displayed on the detail screen. An optional behavior related to a hidden field is disabling that field when it is hidden. A field may also be disabled via a separate rule independent or in lieu of a hidden rule. A disabled field on a wizard screen does not enforce any required values as defined by the target property.
    ~~~~~~~~~~~~~~~~~~End definition~~~~~~~~~~~~~~

    And Lastly most important one that I have added to some of our SAP KBA.

    The definition of an Update rule and how it determines when it gets evaluated:
    Update Rule References a rule definition evaluated in the context of the definition being displayed and expected to return a string value. This rule is evaluated each time the user interacts with any part of the detail screen. The value returned by the rule is displayed in the field. This rule does not change the value of the field if it returns the same value for two or more consecutive evaluations. The external field-OpenUI control edit type is defined to call out from a field to an OpenUI control.

    Now hopefully with all the rules stated above with respect to the targets and what is shown and not shown, it may give you some hints on your rules on why it is not showing any changes.

    For example did you interface with the screen at least two times (click on items) wherein the value of the field was the same for 2 or more clicks? Then this signals the system not to fire the update rule (as it already met the two interactions/touched the screen 2X and the value did not change) or others. To reset the interaction, you need to try to repaint the screen again (then make sure with not more than 2 clicks that the value should change or it will not change at all).

    I hope this helps out.
    Best Regards,
    Mark Pe
    SAP Platinum Support Engineer

    Add comment
    10|10000 characters needed characters exceeded