Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Creating the case throgh a webapplication?

Posted on by Microsoft Employee

Hi All,

       I have to create case throgh a stand alone web application. For that i have created a webform to get the data from users. And i created the service

to connect with my CRM. The issue i am facing is in case form as you knows the Customer field is mandatory. How I can set a default customer for the cases created throgh the webform. I tried so many things. But the error massage comes like , " You should specify a parent contact or account."  Please help me to solve this issue.

      Entity caseent = new Entity("incident");
            // Set the required attributes. For account, only the name is required. 
            // See the Entity Metadata topic in the SDK documentatio to determine 
            // which attributes must be set for each entity.
            Guid contgid = new Guid("8EEDB353-E0B6-E611-80C7-000C29155BE6");
           
            caseent["title"] = title;
            ColumnSet newColumnSet=new ColumnSet(new string[]{"fullname","contactid" });
            Entity RetrievedEntityById = _service.Retrieve("contact", contgid, newColumnSet);
            //  caseent.Attributes.Add("customerid", "CF5DB565-C2B6-E611-80C7-000C29155BE6");
            // Create an account record named Fourth Coffee.
          //  caseent["contactid"] = RetrievedEntityById.Attributes["contactid"];
          //  caseent["customerid"] = RetrievedEntityById.Attributes["contactid"];
           // caseent["contactname"] = RetrievedEntityById.Attributes["fullname"];
            _accountId = _service.Create(caseent);
thanks

*This post is locked for comments

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Creating the case throgh a webapplication?

    this is an early bound class. Check the Notes section of the post and generate a early bound class using CrmSvcUtil

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Creating the case throgh a webapplication?

     Contact newContact = new Contact();

    this shows error for me.

    in which namespace the entity objects of CRM resides?

  • Suggested answer
    Mahendar Pal Profile Picture
    Mahendar Pal 45,095 on at
    RE: Creating the case throgh a webapplication?

    Hello,

    You can follow following options based on your requirements:

    1. If customer is already available in CRM, retrieve it using retrievemultiple method by passing account name so you will get guid of the customer and you can set in case.

    2. Create customer record first and then user it's guid to set into case.

    you can refer CRM SDK for sample code.

    Thanks

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans