Is there IndexChanged event for grid in Acumatica - 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.

Related

Updating data on rows deleted event

I have a custom page with a form and a grid. When a row from a grid is deleted, I want to update some other rows. I am therefore handling the rowdeleted event. I confirmed (through debugging) that the event is firing correctly and that the data is being updated correctly.
The only issue I have is that the screen still shows the old values. My delete row correctly disappears but the other rows do not get updated.
For each row that I change, I am calling the Update method of the Data View. However, this still does not refresh the user interface.
Interesting, if I save, all my changes get correctly updated to the database. Which confirms that this is a UI isssue.
Is there any additional step that I need to perform to refresh the user interface? Or should I just avoid doing updates in Row Deleted event?
To guarantee constant optimal performance level, in the end of a roundtrip grids in Acumatica only update currently selected record. This behavior is by default. In case you insert/update/delete other records in the same grid within an event handler or an action delegate, it's always necessary to call View.RequestRefresh() to force the grid to update its entire content instead of only the selected record.
I managed to solve the issue by calling View.RequestRefresh(). However, I am not sure whether this is a standard practice. But I did find it used in several places in the Acumatica code

dynamics 365 crm - plugin determine when refreshed was invoked

On the retrieve multiple message, is there a way to know when the user explicitly refreshes a subgrid? My plugin needs to distinguish between a refresh and a search/filter. The problem is the query that comes through in retrieve multiple message has filter criteria and sort order, so I cannot use those conditions to determine if it was refreshed.
thanks in advance
In a plugin's RetrieveMultiple handler it is not possible to determine the origin of the query (Lookup view, Active, Associated or Advanced Find view). Plugins are designed to be transparent and do not keep track of the state of the user session spanning multiple requests.
One solution I could think of is to keep track of the user's subsequent actions trying to recognize a second request for the very same page of data for a specific user. In a multiserver (e.g. load balanced) configuration it will not be easy to make this a robust solution. Also, a scenario like opening a window with a specific page, closing it and reopening the same page could lead to unexpected behaviour. I am sure there are a few other issues such a design would bring with it and therefore I would advise against it.

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

Orchard CMS: Invoking two actions leads to duplicate notifications

Our Orchard application displays two of all notifications that are added to the notification service. So far we have traced the problem and know what is causing it, but are looking for a solution other than the obvious, for reasons I shall now elaborate.
So we are using a number of themes to render our Orchard based application. Within our layout, we have a Razor call to draw a header bar that displays a set of information about the user that is logged in.
#Html.Action("OutOfGameHeader", "Options", new { area = "Area.area.Location.Common" })
This action calls the OnResultExecuting() method in Orchard.UI.Notify.NotifyFilter which (among other things) populates the Messages Zone with the current set of notifications. When we make the call the render the Messages Zone, this same method runs again and the notifications are added to the Zone's shape again resulting in duplicate notification being displayed when the Zone is actually drawn.
Can anyone think of a solution that meets the following criteria:
Drawing the header without calling #Html.Action() to avoid OnResultExecuting() being triggered the first time.
Without creating a new Widget in a new Zone as this would involve us changing the manifest for dozens of existing themes to include it.
We also found this just below the point in the code where the notifications are added to the Zone, so if anyone knows anything more about it, that would be helpful too.
//todo: (heskew) probably need to keep duplicate messages from being pushed into the zone like the previous behavior
//baseViewModel.Messages = baseViewModel.Messages == null ? messageEntries .Messages.Union(messageEntries).ToList();
//baseViewModel.Zones.AddRenderPartial("content:before", "Messages", baseViewModel.Messages);
Any thoughts greatly appreciated.
Avoid Html.Action. This runs through the whole lifecycle as if this was a new request. That you think you need it is often a sign that you need to refactor and extract that logic that you want to re-use out of your controller. In Orchard, it's also better to use dynamic shapes.

How should an IPhone notification-type application show user there is a notification unobtrusively

I have a program that basically just queries a webservice, and if any data is returned it will show that information to the user, but if there is nothing to display it will just wait until the next scheduled time and run.
Right now it just puts a table in front of the user, there is nothing in the status bar that they can then select and see the actual information.
So, I have two questions.
Is there a better way to show
notification information to a user
that is less intrusive?
Should the View, with a UITable,
have a button to dismiss the view
when they are finished?
UPDATE:
It seems my question isn't clear enough, so I have the data showing up in the table properly.
My problem is before I display the data.
Currently, periodically the timer will fire off my method, and if there is any events pending for the user the table will show up right in front of them.
That is bad design, IMO, so what I would like is some simple way to let them know that there is something pending and they can look at it when they get a moment.
Ideally I would have something in the status bar to show that they have some events, but it appears that isn't an option that I can see.
One option is to see if I can have the table come up minimized and have some sound or vibration go off, but again that can be bothersome to the user, as it may interrupt what they are doing.
The proper solution appears to be that while in the background just put up a notification if there is any new information, so the user can close the notification or switch to view the details.
This isn't the ideal solution, but appears to be the best choice on the iPhone.

Resources