Showing posts from May, 2019

View Object attribute source order

Source: GitHub

This article talks about the source order of ADF View Object's attributes and how it affects findByKey operation.

As a handy list, we need to remember that there are 3 items which need to be in sync in order for findByKey to work (or for that matter anything to work):

1. Sequence of columns in the ViewObject's SQL.
2. Sequence of attributes in the ViewObject's Attributes tab.
3. Sequence of attributes in ViewRowImpl's AttributesEnum.

Let's see how we can manipulate these orders and destroy our code! In order to demonstrate our use cases, I have a table VIEW_OBJECT_SOURCE_DEMO, which has 2 columns - KEY_ATTR1 and KEY_ATTR2 - which are marked as key attributes. In my AppModuleImpl class, I have a findByKey operation which takes in these 2 string values and returns a single row.

Let's go through the above 3 point list and see where we stand.

My AppModule's method is as follows:

Now if I run this method from BC tester, it works …