Skip to content
This repository has been archived by the owner on Apr 11, 2023. It is now read-only.

Inner Join - VisitCall: Only fields can have operations: CallExpression #70

Closed
mohammadchehab opened this issue Dec 30, 2012 · 9 comments

Comments

@mohammadchehab
Copy link

am getting this error when i try to commit this query am using your example downloaded from the jaydata website.

any ideas ? can you point what am doing wrong ?

ordersQuery = northwind.Orders.filter( function(order) {
return order.Freight> 200
});

northwind.Customers.filter( function(customer) {

return customer.Orders.some(this.filter);

}.{
filter:ordersQuery
}).toArray(function(e){
console.log(e)
})

@robesz
Copy link
Collaborator

robesz commented Jan 2, 2013

Hello @chehabz,

First of all, I wish you a Happy New Year! This is our first office day after your question, but I hope you haven't run out of time!

Too keep your project deadline, I recommend you to pose questions in time. We try to do our bests, but the community support questions are answered sometimes a few day later, as we have to close the Enterprise Support tickets first. Of course our goal is to help everybody as fast as we can :)

According to my test, the example is working fine, please provide me more details, which one is not working for you, our team will fix it quickly.

Your code snippet threw us a different syntax error, but was working after changing the '}.{' to '},{'

ordersQuery = northwind.Orders
  .filter( function(order) { return order.Freight> 200;});

northwind.Customers
  .filter( function(customer) { return customer.Orders.some(this.filter);}, { filter:ordersQuery })
  .toArray(function(e){ 
     console.log(e)
  })

There I few things I recommend you to check:

  1. Verify if you expose OData v3 on the server-side, as some is supported only in v3, not in v2 (this is the default). Navigate to InitializeService() of your svc.cs and verify the MaxProtocolVersion.
    The expected one looks like below:
config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3;
  1. Check if you define the value of maxDataServiceVersion parameter at the context initialization:
var northwind = new JayDataExamples.NorthwindDB.NorthwindEntities({ name: 'oData', oDataServiceHost: 'Northwind.svc' , maxDataServiceVersion: '3.0'});
  1. Check if you use the latest version of JayData library and OData provider, 1.2.6 is available at our CDN:
<script type="text/javascript" src="http://include.jaydata.org/datajs-1.0.3.js"></script>
<script type="text/javascript" src="http://include.jaydata.org/jaydata.js"></script>
<script type="text/javascript" src="http://include.jaydata.org/jaydataproviders/oDataProvider.js"></script>

I hope this checklist solves the issue, please let me know about your results.

Best regards,
Robert

@PeterAronZentai
Copy link
Contributor

This is eloquently put. I would just amend with an apology: we have had Christmas holidays in the past couple of days, and community support was on vacation from 25th December to 1st January. That further delayed our capacity. But now that XMAS is gone let's just push the engines into throttle. Thanks Robert.


Feladó: Robert Bonay [notifications@github.com]
Küldve: 2013. január 2. 16:01
Címzett: jaydata/jaydata
Tárgy: Re: [jaydata] Inner Join - VisitCall: Only fields can have operations: CallExpression (#70)

Hello @chehabzhttps://github.com/chehabz,

First of all, I wish you a Happy New Year! This is our first office day after your question, but I hope you haven't run out of time!

Too keep your project deadline, I recommend you to pose questions in time. We try to do our bests, but the community support questions are answered sometimes a few day later, as we have to close the Enterprise Support tickets first. Of course our goal is to help everybody as fast as we can :)

According to my test, the example is working fine, please provide me more details, which one is not working for you, our team will fix it quickly.

Your code snippet threw us a different syntax error, but was working after changing the '}.{' to '},{'

ordersQuery = northwind.Orders
.filter( function(order) { return order.Freight> 200;});

northwind.Customers
.filter( function(customer) { return customer.Orders.some(this.filter);}, { filter:ordersQuery })
.toArray(function(e){
console.log(e)
})

There I few things I recommend you to check:

  1. Verify if you expose OData v3 on the server-side, as some is supported only in v3, not in v2 (this is the default). Navigate to InitializeService() of your svc.cs and verify the MaxProtocolVersion.
    The expected one looks like below:

config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3;

  1. Check if you define the value of maxDataServiceVersion parameter at the context initialization: javascript var northwind = new JayDataExamples.NorthwindDB.NorthwindEntities({ name: 'oData', oDataServiceHost: 'Northwind.svc' , maxDataServiceVersion: '3.0'});
  2. Check if you use the latest version of JayData library and OData provider, 1.2.6 is available at our CDN: <script type="text/javascript" src="http://include.jaydata.org/datajs-1.0.3.js"></script> <script type="text/javascript" src="http://include.jaydata.org/jaydata.js"></script> <script type="text/javascript" src="http://include.jaydata.org/jaydataproviders/oDataProvider.js"></script>

I hope this checklist solves the issue, please let me know about your results.

Best regards,
Robert


Reply to this email directly or view it on GitHubhttps://github.com//issues/70#issuecomment-11810621.

@mohammadchehab
Copy link
Author

Hello, Happy holidays and thank you for the reply.
It is a sad thing that I finished the project without the use of jayData. However I'm planning to reconstruct the data access layer using your jayData library again because i see the strength of jayData and the future of this library is amazing. I work for a major construction company and we are targeting all the new tablets and smart phone mobiles so a solution for an offline - online storage is a must.

As for the syntax,I really don't think that the syntax is the main issue in here I've written it directly in this box. Where at my local testing environment am using firebug and web developer addon so when i was testing it on the browser i had no syntax errors !

So here's what i did :
re-downloaded a fresh copy of your Northwind demo :
1- Upgraded the references to Entity framework 5.0 removed system.Data.Services and replaced with
Microsoft.Data.Edm,,... oData.
2 - Changes in the js Initialization maxDataServiceVersion: '3.0'
3 - Hit the run button and everything was working as crystal.

Conclusion : JayData is the deal !! @robesz Thanks you for your amazing help @PeterAronZentai Thanks for treating me as a 1 million dolor costumer. 👍

Where can i register to get enterprise support ?

Thanks !!

@robesz
Copy link
Collaborator

robesz commented Jan 3, 2013

Hi @chehabz,

I'm really glad to see your intention to reconstruct your app with JayData, this is what lifts the spirit in our team! :)
The online/offline scenario and the wide range of devices aligns to our current feature-set and long-term roadmap, plus it's super cool! :)

After your mentioned firebug, it came to my mind that you use Firefox, which means you need to use the patched datajs.

Regarding the enterprise support....you can compare the default 2 plans at http://jaystack.com/support/plans

We are planning to launch free one-to-many webinar in few weeks. The idea is to dedicate an architect one/twice a week for a session to a pre-registered group of the community. Indicate your interest in a short e-mail (info @ {libraryname}.org) and I will notify you right after publishing the details of this program.

Bye,
Robert

@mohammadchehab
Copy link
Author

Rebuilt with JayData... :)

@mohammadchehab
Copy link
Author

Hello @robesz any updates regarding some to work with offline stores?

@mohammadchehab mohammadchehab reopened this Feb 7, 2013
@robesz
Copy link
Collaborator

robesz commented Feb 7, 2013

Hello Mohammad,

The currently supported operations are represented in the following table for each providers:
http://jaydata.org/tutorials/jaydata-api-features

Every() and some() operations are supported only in inner queries on OData provider. These operations aren't on our roadmap right now, but you and other developers of the community can influence the roadmap by expressing your business need here: http://jaydata.org/backlogs . Let's hope other developers will upvote it, too.

@robesz robesz closed this as completed Feb 7, 2013
@mohammadchehab
Copy link
Author

@robesz Honestly am looking for enterprise support i tried calling and got no answer. I need some explanation on things who can help me?

@robesz
Copy link
Collaborator

robesz commented Feb 7, 2013

Please call the number again, I will assist you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants