08-31-2009 09:22 AM
Hi,
Is there a way to query the DB using javascript? Is there an API I can use, and how does SData fit into all of this?
Thanks
~ Henry
08-31-2009 09:28 AM
You have 2 options...
Mashup's
and
NamedQueries
Here is a link to a named query example. This requires server side code to build the query and clientside code to call the query via javascript. I use this all the time so I can move the database query part of my controls over to the client.
http://sites.google.com/site/genesprojects/code/namesqueryclientside
08-31-2009 09:31 AM
The sData "protocol" is simply RESTful web services based. You can form the URI strings yourself but will have to deal with the returning "payload" (in atom xml or JSON).
With the release of SP2 (in beta) there have been changes in sData (in the request as well as payload). SP2 will have a set of .NET libraries for use by apps to isolate you from potential future changes.
FYI: Consider sData in SP1 as a prelim... (ex: .9 release) and sData in SP2 as 1.0. I suggest you take a look at the SP2 beta forum for additional info.
09-01-2009 10:52 PM
Both solutions suggested are correct. Depending on where you want to access the data. If you are accessing from an external website I'd look at our SData API. If you are internal to the Client I would follow Gene's advice.
John Perona
Director, Infor CRM DevelopmentInfor CRM
01-26-2012 08:16 AM - edited 01-26-2012 08:19 AM
I try to use a named query, using Gene's code as an example.
What I do not understand in the example: Where is the definition of the query? I see a query Oppo28Target is executed, but where is it defined?
I see the server side code example - but I like to execute the query in a client script. At which time do I have to write the serverside script?
Thanks for your help.