Re: Available objects in onChange-events? by Aaron
Aaron
Fri Aug 27 15:57:26 CDT 2004
The CRM Application actually does this quite a bit, you simply need to make
Web Service (or just plan XML) call to the CRM Server from Script.
Microsoft provides a rather bloated Web Service.HTC or you can follow this
more simplified pattern.
Create an ASPX page on the server, this page will act as a wrapper to the
CRM Platform... it takes information from the GET/POST and sends them to the
platform via our standard SOAP SDK. The page then returns XML in either
your own format or in ours.
From the client - use XMLHTTP to open a connection to the wrapper page,
passing required information via the QueryString (or POST if you get fancy).
The client will then load the XML and you can use it as you see fit.
Example:
Client-side page loads
Create an XMLHTTP ActiveX Control in JavaScript (var oXml= new
ActiveXObject("Msxml2.XMLHTTP");)
Tell XMLHTTP that you want to make call synchronously (oXml.async = false;
for GET via the open method for POST)
Call the URL to your wrapper passing in required information
(oXml.load("mywrapper.aspx?id=123", for GET via the open method for POST)
Your wrapper page is invoked on the server
Your wrapper page calls the platform and Response.Writes the XML to the
client.
The client then has a standard XML DOM loaded with the XML that was returned
from the Platform (and your wrapper)
Use the data as needed.
Hope this gets you in the right direction.
Aaron Elder
===============================================
Microsoft Customer Relationship Management
Core Application Development Team
===============================================
This posting is provided "AS IS" with no warranties, and confers no rights.
"Matt Parks" <mattp65@RemoveToX_XYahoo.com> wrote in message
news:3thki0lrgc11ujlr4au8gbd3c8dsp4tf27@4ax.com...
> Paul,
>
> The CRM objects reside on the server, the javascript is going to run on
> the
> client. Unless you add server-side controls, you're not going to easily
> tap
> into the server objects from the javascript. There may be ways, but
> somehow I
> don't think it will be that easy.
>
> Matt Parks
> MVP - Microsoft CRM
>
> ----------------------------------------
> ----------------------------------------
> On Mon, 23 Aug 2004 02:33:02 -0700, "Paul"
> <Paul@discussions.microsoft.com>
> wrote:
>
> So this means it's not possible to access any of the "real" .NET
> CRM-objects
> through javascript, right? Only HTML form elements?
>
> "Matt Parks" wrote:
>
>> Paul,
>>
>> You have access to everything on the form from the javascript that you
>> write and
>> it is basically the same javascript that you would write anywhere.
>>
>> Matt Parks
>> MVP - Microsoft CRM
>>
>> ----------------------------------------
>> ----------------------------------------
>> On Sun, 22 Aug 2004 04:57:01 -0700, "Paul"
>> <Paul@discussions.microsoft.com>
>> wrote:
>>
>> I'm just wondering what objects and functionality is available when using
>> the
>> onChange event
>>
>> - Thanx
>>
>>
>