Dear all,
I am new to CRM data connections so I have been doing some research, trying samples and snippets online however I have decided to start from the beginning instead of hacking up the samples. I hope you can help me get up and running with a javascript rest samples available from the CRM SDK to do a simple create opertaion to CRM Online.
For both Jquery and Javascript samples, the first message I received was 'Context is not available' called by the context function. What I started to do was edit the web config file to enter the crm connection string, straight from the example provided:
<connectionStrings>
<add name="Server=CRM Online, organization=mycompany, user=myusername" connectionString="Url=https://mycompany.crm4.dynamics.com; Username=myemail; Password=mypassword;"/>
</connectionStrings>
Following that, I explicitly instantiated the crmconnection and context variables under the context function:
CrmConnection connection = new CrmConnection("CRM");
//CrmConnection connection = CrmConnection.Parse("Url=http://mycompany.crm4.dynamics.com; Username=myusername; Password=mypassword;");
//var connection = "Url=http://mycompany.crm4.dynamics.com; Username=myusername; Password=mypassword;";
var service = new OrganizationService(connection);
var context = new CrmOrganizationServiceContext(connection);
The result was more undefined messages or 'expected ;' messages. If I used CrmConnection, I receive the error expected semicolon, if I used var connection I receive organisation service is undefined.
I started adding references to use the Crmconnection class and the organisationservicecontext class such as Microsoft.Xrm.Sdk, Microsoft.Xrm.Client and many others.
Still, lots of undefined and expected ; messages. From this point I started hacking up the code until it didn't even look like the sample anymore. E.g. removing the service variable, getting a readystate of 0, etc.
So back to the start, can anyone help with the initial 'expected ;' error using the crmconnection ?
I would really appreciate it, and it is valentines day after all.
Regards,
Steph