Question

How to set tag filter in section?

I have a section action that calls a configuration service. This service creates some new records in the section and then creates a tag and adds the new records to the tag. The service then returns the tag's Id to the client code. All of this is working fine, I can then select the tag to see the records. However, I want to set this tag filter automatically for the user. 

How can I programmatically set this tag filter so the user automatically sees the results of the tag? 

Thanks,

Ryan

Like 0

Like

3 comments

I see there is a method addFilter in TagFilterViewModelGeneratorV2.js and from what I tested it adds a tag to grid filters. Unfortunatelly I don't know how to call this method from normal client code. It would be probably possible to override this module and subscribe it to some custom message that calls addFilter but from what I know bpm'online discourages that level of front-end code modification. I also read somewhere that they want to remove the options to use replacing client modules anyway.

Carlos Zaldivar Batista,

Thanks for the reply.

I had seen that, was just hoping for an easier approach, but maybe that is my best option. I was thinking that the notifications seem to do this after a file is imported. You can click the notification and be taken to view the imported records (which is essentially setting a tag filter in the section). Looking at openSectionWithImportTags in SystemNotificationsSchema looks promising and should work, basically adding the tag config to the filter storage and then navigating to the section. I will try that approach. 

Ryan

Carlos Zaldivar Batista,

FYI The approach from openSectionWithImportTags in SystemNotificationsSchema did work!

Show all comments