Mattersphere Developers Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Go down
avatar
Admin
Admin
Posts : 122
Join date : 2018-12-17
https://mattersphere-devs.forumotion.com

Capturing Event When File Displayed Empty Capturing Event When File Displayed

Thu 23 Jan 2020 - 16:22
Hi, I was wondering if anybody knows which event is fired when a user opens / displays a matter (i.e. not when a matter is created) I would like to do some scripting at that time.
Thanks
Steve
_______________________________________________________________________________________________________________________________
Wouldn't we all !!!

The standard answer is to put code in the rendered event of the first tab to be displayed in the matter. however if you open a matter via code you can specify a different tab to be displayed which would prevent the code on the first tab firing (at least until the user clicked on it)
We got around this by creating a user defined control that is invisible and is added to each tab, on its parent changed event we get the parent form and do a search for any controls of that type.
if they exist the new control removes itself, otherwise it runs our 'matter open code' which is contained in separate DLL's depending on the matter type, messy I know but it was the only way we could change the forms default title to display our accounts matter number and description rather than the matter centre CXXXXX/MXX which has no meaning to our users, and log an event that the matter was opened + a bunch of other 'case open' type tasks

G
_______________________________________________________________________________________________________________________________
Hi
What Graham is highlighting is trying to reshape the built in User Interface at load time, is there a more specific thing you are trying to do?
It is very important to gather a couple of things when trying to couple onto Parent objects ---->

"MEMORY MANAGEMENT" is a serious issue when you don't properly dispose/de-attach your references. Garbage collection is good but can't understand if you have a rooted link to a Parent object that it is actually ok to be released from the Heap and therefore cleared from Memory, we have seen a couple of scenario's where an OMSType window is loaded into memory and closed and everytime the OMSType window was reloaded it would load a "NEW" copy in memory leaving the original, in the course of a day this can be huge!!!!

We go through our core code to profile this and have found bugs in WIndows Forms that were not appropriately releasing memory nothing to do with our code so just be aware. Graham is using a work around to help him in his scenario which is fine but there are caveat's behind all things like this as stated.

Let us know what the specific thing you are trying to do.. If it is a User Interface based scenario then that is one thing that is possible to do on a Rendered event if you know you will always open the same base form. If it is business layer related then in Filemanagement (Taskflow) there are events fired on the File Event that you could look to intercept and do some base processing, I again would advise caution and to filter the eventargs to only process where necessary otherwise you may make a bad experience.
_______________________________________________________________________________________________________________________________
Hi Mike,
Yes we are aware of the dangers and don't hold any references to the parent except at local level whilst we do the search for controls and we then clean up after ourselves ;o)

It would be nice to have a OMSType_Open scriptable event (and Close of course) as the logging matter state is one of our client's requirements and would also help with 'Hiding/Adding Tabs which again our control handles for us

G
_______________________________________________________________________________________________________________________________
Of course all developers clean up after themselves, that's why we have cleaners Wink
I know we did some stuff on the TABS generally, but can see a logic maybe to review an idea of adding a script to a "ConfigurableType", on this we could have this loaded as a container for either UI or BL based coding, would be keen to know if anyone else has any ideas on this?
Back to top
Permissions in this forum:
You cannot reply to topics in this forum