AnsweredAssumed Answered

Update portlet filter default choice via XOG or GEL

Question asked by BChinn on Jun 30, 2018
Latest reply on Jun 30, 2018 by urmas

I have a portlet that needs to have the default value of its filter changed every month.  

at the start of the month, a custom object has a new instanced added by GEL script.  

the portlet, filter allows the user to pick one of the months and show data for that month.

the portlet filter is based on the object instance lookup.  the issue is that at the start of the new month, when object instance is added, i need the portlet filter to default to the new month.  

Currently the filter (for month/year) is not required, so the "default" value seen is "All", which i have coded in the NSQL to be the same as selecting the current month, however, it's confusing because it could be interpreted to show the aggregate values of all months (which the portlet does not do.  

I want to make the filter value required and have it default to the current month.   i have identified 3 options

1) manually change the filter default at the start of the month.  want to avoid that.

2) use <sql:update> in GEL script to change the DEFAULT_VALUE field in the ODF_VIEW_ATTRIBUTES table, but this requires either a service bounce or a FLUSH ALL from the nu#action:security.caches page for the value to show in the GUI and as far as i know, neither of those actions can be called from GEL.

3) use XOG via GEL to change the filter default, but there's no way to just XOG in the filter value, i'd have to XOG in the entire portlet just change the filter value, and i'm not sure how smart/safe that would be in a live environment.  I know how to do very basic getting/setting attributes in XML documents in GEL, but not sure how to do it with the filter value so deep into the code.


so, is there a way to, via XOG or GEL, update just that one portlet filter default value?