web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Create entity using client side code using SOAP

(0) ShareShare
ReportReport
Posted on by

Hi all,

I am developing my code in jquery .Now, i want to create new entity so for that I have to use soap but how can I put my soap code in jquery  I dont't  understand..Can you help me by putting code here?

I really need help.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    anilambadan Profile Picture
    1,160 on at

    Please check the following code.

    var createEmail = new XrmServiceToolkit.Soap.BusinessEntity("email");

       createEmail.attributes["subject"] = "Test Email subject";

       createEmail.attributes["description"] = "This email was created by the XrmServiceToolkit.Soap.Create() sample.";

       var from = [

          { id: whoamiUserId, logicalName: "systemuser", type: "EntityReference" }

       ];

       createEmail.attributes["from"] = { value: from, type: "EntityCollection" };

       var to = [

          { id: accountId, logicalName: "account", type: "EntityReference" },

          { id: contactId, logicalName: "contact", type: "EntityReference" }

       ];

       createEmail.attributes["to"] = { value: to, type: "EntityCollection" };

       var cc = [

          { id: accountId, logicalName: "account", type: "EntityReference" },

          { id: contactId, logicalName: "contact", type: "EntityReference" }

       ];

       createEmail.attributes["cc"] = { value: cc, type: "EntityCollection" };

       var bcc = [

          { id: accountId, logicalName: "account", type: "EntityReference" },

          { id: contactId, logicalName: "contact", type: "EntityReference" }

       ];

       createEmail.attributes["bcc"] = { value: bcc, type: "EntityCollection" };

       createEmail.attributes["directioncode"] = true;

       emailId = XrmServiceToolkit.Soap.Create(createEmail);

    Please download XrmServiceToolkit from the following link

    xrmservicetoolkit.codeplex.com

    thanks

    Anil

  • Community Member Profile Picture
    on at

    I have added code as per you suggest

    3324.Capture.PNG

    But  when it exits from     var createEmail = new XrmServiceToolkit.Soap.BusinessEntity("email"); line.

    what should i do?

  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at

    NikkiShah,

    1. Open SDK\SampleCode\CS\Client\SOAPLogger application from SDK

    2. Paste code from (msdn.microsoft.com/.../gg509014.aspx) to create entity after below line in SOAPLogger.cs file

    //Add the code you want to test here

    3. Run your code and check for the output.txt file created under bin folder

    4. Use that code in your web resource

    Have you tried ?

    Here is complete steps: nishantrana.me/.../updated-soaplogger-for-crm-2013-to-generate-javascript

  • anilambadan Profile Picture
    1,160 on at

    Replace it with whichever entity to you want to create and replace all the fields with corresponding fields related to your entity.

  • Community Member Profile Picture
    on at

    yes,I have tried to create entity like this,but when i integrate with MS Dynamic CRM it gives me error couldnot be able to open a form.

    At present,I have to create entity using javascript ,and I Have created as per previously attached image but it exits from  XrmServiceToolkit.Soap.BusinessEntity("email"); line.

    though,i have added that toolkit.

  • Community Member Profile Picture
    on at

    Anil Antony ,

    I have changed my code .but the problem is ,"XrmServiceToolkit is not defined",though i have already added js

  • Community Member Profile Picture
    on at

    Hello all, 

    Can you have a solution of this error.

    "XrmServiceToolkit is not defined",

    though I have added toolkit


    <script src="Scripts/jquery.js" type="text/javascript"></script>
    <script src="Scripts/json2.js" type="text/javascript"></script>
    <script src="Scripts/XrmServiceToolkit.js" type="text/javascript"></script>
    <script src="Scripts/XrmServiceToolkit.min.js" type="text/javascript"></script>

    Please help me

  • Mahendar Pal Profile Picture
    45,095 on at

    What is the name of the html web resource? if your html web resource name is like :  new_test.html then recreate it and use name new_/test.html (put / before name)

  • Community Member Profile Picture
    on at

    Thank you himbap for your reply

    My web resource name is new_createentity .

    As u suggested i have tried with new_/createentity but still it gives like "XrmServiceToolkit is not defined".

    XrmServiceToolkit can used to create a records ,is it used for create entities.?

  • Mahendar Pal Profile Picture
    45,095 on at

    Can you share screenshot how you are using and referring XrmServiceTookit

    XrmServiceToolkit - It is a library written, that can help you to consume CRM service using java script, you should FIRST READ documentation before using it.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans