Question
· Aug 3, 2016

Message search - Time Format

Hello guys,

One thing keeps annoying me and I'm pretty sure it does many other people (my workmates as well, lol): every time I access the 'Message Viewer' screen, the 'Time Format' come with 'Time only' as a default. Can I make 'Complete' as the default value for it?

Thanks!

Discussion (2)0
Log in or sign up to continue
  1. Inherit from EnsPortal.MessageViewer
  2. Copy searchPane from EnsPortal.Template.filteredViewer
  3. In searchPane, TimeFormat node replace attribute  value="12" with value="999"
  4. Compile. Your new class would have Complete as TimeFormat default value

Alternatively, instead of 2-4 you can set TimeFormat value in your class by overriding some init callback ( %OnAfterCreatePage maybe, don't forget to call ##super() though) and setting it there. It would be a better solution.

2020 UPDATE.

I think I found a better solution.

1. Extend EnsPortal.MsgFilter.Assistant class.

2. In this class redefine EnumerateExecute method to provide the desired format. Replace this line:

Do ..addTerm(.aSelect,"{fn RIGHT(%EXTERNAL(head.TimeCreated),"_dateLen_"
)} As TimeCreated")

to provide the format you need.

Alternatively redefine OnFinalizeSQL to replace

{fn RIGHT(%EXTERNAL(head.TimeCreated),999)}

with something else.

3. Set the global

^EnsPortal.Settings("MessageViewer","AssistantClass")

to the value of your class.

This looks like an official way to modify MessageViewer behavior.