Catching a save event globally in a datastore in xpages - xpages

I have an application with a number of data stores in a number of different xpages and cc's. I'd like to catch all events when one of those are saved for logging and some other stuffs (it is not just logging). Is there a global "save data store"-event that I might subscribe to? I can find all those data stores and add a script in every querySaveDocument and so on but that is tedious and I will miss some.
Is there a way to catch that event in one spot?

Related

NetSuite: Calling an API in real time as field values get updated

I'm looking for a way (using SuiteScript 2.0) to handle real-time persistent (stored) field updates, where a field might have changed in NetSuite (for example a lead time was just updated), and it doesn't matter if a user saved the change, or some other automated process changed that field. I just want to be able to pick up on that change:
The moment that it's done, and
Without regard for who or what kicked it off (e.g. it could be a person, but it could also be an automated change from a workflow, or a formula on the field itself which pulls values from another field)
Doing some research I found some options that looked somewhat promising at first. One being the afterSubmit event in a client script, and the other being the fieldChanged event. My issue however is, from what I understood those only really seem to be triggered by a user manually going in and making those changes, but this is only one part of the puzzle and doesn't seem to cover changes made outside of the scope of the user making those changes. Is that correct however? Or would one of those events still be able to capture changes done to that field regardless of who (or what) initiated or triggered the change, and right at the moment the change was saved/ persisted to the database?
UserEvents are basically triggers. In their deployment records you can set the context in which they fire so you can get them to fire in all circumstances (called contexts in Netsuite) but one.
That circumstance is User Events are not fired for record saves made in User Event scripts. i.e., if an AfterSubmit UserEvent script loads, changes and saves your record a fresh user event will not be fired.

Is there IndexChanged event for grid in Acumatica

Acumatica has plenty of events for views like Row_Updated, Field_Updated. I search for something like Index_Changed event but for now I can't find. Does it have some other name or exists at all?
There's no row selected index changed event that will bubble up to the graph. Instead there's a bunch of mechanisms designed to solve a narrow problem that would have required that missing event, these are the likes of DependOnGrid, StateColumn, AutoCallback/Refresh, Sync Position etc.
The reasoning behind this design could be to reduce the number of callbacks from the webpage to the server. From the user point of view, changing row selection is not a transactional operation. Having the webpage wait for the server at that time would make the webpage appear sluggish.

is plugin execution synchronized for delete message over multiple records?

I am new to Dynamics CRM and I could not find any information so far that would apply to my scenario.
We have a Program entity that can have/reference multiple program dates entities, and each program date can have/reference multiple event entities.
We have a view displaying all events associated with the program, and on the program form we want to display in a text the total number of events. From the view user can select multiple events then click delete button. This is a button that comes with CRM, not a custom one.
If I create a plugin for Delete message on event entity and want to query both program and Program date filed that keeps the total number of events then subtract one I am not sure these plugins will execute in sequence or concurrently thus having a race condition.
Now using javascript I also do not know if it is possible to read entity records PK and hook up into the pop up Confirm Deletion dialog box and execute after that a web service call
Any ideas?
Thanks
Dan
The deletes will process synchronously for the current user, but there is nothing that is preventing another user from performing deletes on Events that are also associated to the Program.
One option that you could look at is creating a flag on the Program and Program Date entities called "Events Deleted". Then create another plugin on the read that checks to see if it's "Events Deleted" flag has been flipped, and if so, recalculates the value, updates it and clears it's flag so it doesn't get calculated again.

Breaking down 1 calendar event into smaller events in SharePoint

I'm trying to create some sort of reservation system in SharePoint using a calendar list. It's been recommend to me to create events and add a column which allows a user to claim it. From there, claimed events would change color and only those who've claimed the event would have permission to unclaim the event.
This is what it would look like (see alternative option):
What I'd like to be able to do though, is instead of having to create three events like shown in the alternative option, creating 1 event (see original) and have that be broken down into 3 events or more, maybe using some form of drop down asking for intervals (ie. 15m, 30m, 1h). Based on the selected interval, it'd break the event accordingly.
A possible solution is in your main event you add another field named Interval.
The you design a workflow when you create the event that creates new events according to the interval specified using a while loop while incrementing the start time with your interval.
Those new events have a content type with a field named UserClaimed. you then associate another workflow to those new events that checks for that field and changes permissions on the event to only allow modifications of that event to the user specified.
This is the general idea, the implementation should not be that hard
just a thought -
I mean, the reason i think you want the events to pre-exist is so that users can easily create them in the correct time slot (rather than clicking the new item menu, which throws them away from the calendar view/context). Is that right?
If so, allow me to offer you this scenario:
If you are using KWizCom's Calendar Plus web part (yeah, I work for KWizCom...) it allows you to type in the event in the calendar itself directly.
Something simple like: "1pm-2:30pm Training meeting with Josh"
check the demo video here: http://www.kwizcom.com/sharepoint-add-ons/sharepoint-calendar-plus-web-part/overview/
Also, drag and drop events in the calendar to move them easily, and it also supports color coding events based on categories (meta data, views, sources, etc.).
The one thing you will need to develop is the unique meeting logic, and owner permissions.
meaning, an event handler that does not accept 2 meetings at the same time for the same room (define the unique resource field, if any), and the logic that allows only the person who created an event to edit or delete it.
ping me, I can help with the event handler - perhaps we can add this to our product, this is actually a cool idea. my work mail is shai at kwizcom dot com

Adding logging in Lotus Notes form

I want to add logging capabilities in my Lotus Notes application. Basically I want to be able to log who make the change, when the change is made, and what field(s) is/are changed in a document. What is the best way to do this? I am thinking to also add this at the end of each document so the user knows who make the changes.
OpenNTF has several tools for this purpose that you could use, including Open Audit and Audit Manager.
I've done this before using LotusScript. It's a bit of a pain, but the basic idea is to:
Create an array or new document object within the QueryOpen event, and store the values for all the items in the current document.
In your QuerySave event, compare the values of the current document to the in-memory copy you made, and then log any differences.
You can create a field on the form to write these changes to, and just append to it each time.
Watch out for other event handlers that make changes everytime the document opens, though. You may need to copy original values in the PostOpen event, for example, if you change some fields in the QueryOpen event each time the doc opens, otherwise you'd get false change logs.
Hope this helps!
A "brute force" approach can also work. Every time a document is saved, create a copy of that version to a (separate) database. This will build an audit trail of the documents. The documents can be compared to extract the changes.
There is quite some overhead in this approach, but in my experience it has been worth it. The implementation is simple and all changes are captured without affecting the actual document. All information that is needed is captured and available for (offline) processing.

Resources