Make limit of results in Oro datagrid - datagrid

I want to make a limit of query result in a datagrid.
The Oro documentation does not specify that there is a key allowing to limit the results so I tried to create a listener in order to modify the query builder before its execution. Unfortunately it's not running.
Does anyone have a solution please ?

Related

The required QueryBuildDataSource was not found in the Query associated with the FormDataSource

I've extended the SalesTableListPage to include a new column taken from a display method on CustTable now my users are getting the error:
The required QueryBuildDataSource was not found in the Query associated with the FormDataSource . The QueryBuildDataSource should have the same name and table ID as the FormDataSource.
To gain access to the display method I had to:
Add CustTable to the SalesTableListPage Query
Re-Select the SalesTableListPage Query on the Data Sources node of the SalesTableListPage Form.
Add a new StringEdit on the grid and set it to CustTable CityName_BR
I can't replicate this error with my admin or my non-admin user and I don't understand where this error comes from.
One post says that if you have a Query on the menu item that opens the Form then that query needs the same data sources as the query on the form. But I don't have a query on my menu item
Other suggestions state that I need to add the new data source "in the Table related queries". I am unaware of such a setting in AX 2012
Other suggestions refer to queries written in code. mine are AOT queries
Update: It seems the reason I wasn't getting the error was that I had the CueGroup EPCustRelatedInfo or just CustRelatedInfo collapsed. When I unfold this part I am getting the error as well.
Resolving that Cue Group has led me to several menuitems with queries attached. The culprit seems to be the SalesTableListPageOpen menu item and query of the same name (which references the query I have changed).
I am however still confused as to how to actually fix the error since the SalesTableListPageOpen query just says Composite Query\SalesTableListPage. Unsetting/resetting the referenced query, restoring and re-compiling the query has not had any effect...
I think one of your suggested solutions is probably correct. Just investigate the query though and you should be able to figure out what's happening.
At the bottom of \Classes\SalesTableListPageInteraction\initializeQuery just put:
info(_query.toString());
Then open the menus All sales orders and Open sales orders and you'll see the query differences. Then repeat opening various menu items with different users and see what results.
You may need to move the location of the info line, but the concept is there.

How do I create a Firebase collection?

So I am writing a chat application that I want to have multiple rooms, however, I can't find a button on the Firebase console that I can add child collections.
I've tried exporting, editing, then importing but that doesn't seem to do much. I have looked at some Firebase tutorial's but I can't find one that explains this.
Anything you enter in the console has to have a value itself, or at least one child (with a value). This is because Firebase does not explicitly store "null" or empty values in the database. You can enter the name of the collection and then rather than a value use the + button at the right to start adding children to it and so on until you reach a node with a value:
You cannot however simply create a placeholder for a collection that has no values. If you need a collection but can't initialize any of its data, just use your security rules to define what's allowed and write your client code knowing it may or may not exist. Firebase allows you to attach listeners to nodes that don't exist yet.

Meteor pagination: cursor fetch limit with getmore

I have an infinite scroll page where I'm not using Meteor templates to draw the items. The reason for that belongs in a whole other thread. I'm trying to figure out how to paginate the data without fetching all the items at once. I have an idea about using a limit on the cursor, but can't find any real samples online of the proper way to do this.
Should the server call return the cursor itself or just the find with limited data set? If the server doesn't return the cursor itself, won't I lose position when I try to fetch the next set of results?
Also, I want to make sure to retrieve data from the same cursor. Like if there are currently 100 items and I fetch 20, I expect the next 4 fetches to get 20-40, 40-60, 60-80, and 80-100. If in the interim some items got inserted or deleted, I don't want it to mess up the fetches. I am handling reactivity separately and letting users decide when to update the items (which should reset the cursor).
Help/advice appreciated!
What you would usually do is this:
var cursor = collection.find({},{limit:100+20*page});
The first {} is obviously the selector!
Docs:
http://docs.meteor.com/#/basic/Mongo-Collection-find
You don't have to worry about returning only the values 100-120 and then 120-140 etc. since meteors ddp does that for you!
If you were using meteor's blas or you just want to have the reactivity, you should probably store the page variable in the Session or create a dependancy:
https://manual.meteor.com/#deps-asimpleexample

Sql Database Server

Hi i have a sql database server runnin on my desktop. I want to create an asp.net application to detect when new data has been inserted into the database. Is there a command in visual studio to detect when theres new data right away?
Use the timestamp datatype on each column. This will stay identical until a change is made to any column in that row. If you combine this with the rowcount you can be certain if anything has changed in your database. You would need to cache the current timestamps and row count and compare them with the results of a query, you can then find out if there is a change.
So in your answer to:
Is there a command in visual studio to
detect when theres new data right
away?
Yes there is, although its not a command is the timestamp function (not to be confused with anything to do with the time)
Perhaps you need to provide more details to your scenario since constant querying of the database might not be the best way forward.
You can get a row count of your dataset and create a application
IN VB
Dim i as Integer
i=dataset.tables("table").rows.count
in sql backed return a count of a table and create a ASP.Net website to get the count and when count change alerts you
It may be heavier duty than you are looking for, but SQL Notification Services will do what you want. Essentially you execute a query and tell notification services you want to be notified whenever re-running that query would produce different results.
if you are using caching you can make it dependent on sql.
or you can fire email using sql trigger so when ever trigger get fired you will receive an email.
otherwise you will have to check your db again and again for any changes.
if you can provide more details about exact situation , we can provide more specific solution
You can create a webservice and call it using javascript.
here you can find sample how to call webservice using javascript:
function CallWebservice()
{
myWebService.isPrimeNumberWebService.callService(isPrimeNumberResult, "IsPrime",
testValue.value);
setTimeout("CallWebservice()",100);//here set time according to your requirement
}
For timer in javascript:
http://dotnetacademy.blogspot.com/2010/09/timer-in-javascript.html
For webservice in javaScript:
http://www.webreference.com/js/tips/020715.html
How to call webservice in JavaScript for FireFox 3.0

Linq update problem

I have an application with user and admin sections. If an admin updates data with the help of sql datasource then it's updated the database. However, when we retrieve data with linq query then it's showing its old value rather than the updated value.
After some time, the linq query automatically shows the correct value.
I think its caching the value, but I find myself helpless. Please help me with this.
When you say
when we retrieve data with linq query
Do you mean you call your select methods again or are you using the current in memory objects?
In either case, you can always refresh an entity with :
Context.Refresh(System.Data.Linq.RefreshMode.OverwriteCurrentValues, entity)
Make sure that you're using your DataContext efficiently (ideally one per unit of work).
After each update, make sure you call DataContext.SubmitChanges(); to commit your changes back to the database.
Also be aware that any context you instanciate between your changes being added to another context and calling SubmitChanges() will not reflect those changes.

Resources