locked
Creating Account entity record using CrmService SDK. RRS feed

  • Question

  • Hi All,

    I am trying to create an Account entity record with the name as "Magic Account" using CRM SDK. I have written the code to for this in console application. When I excute, I see the error "Server can not process your request." But after the name as "Magic" I could able to create the record successfully. I am not able to create record with space in between. How can I achieve this using CRM SDK?

    Thanks,

    lkdhage

    Tuesday, June 1, 2010 5:50 PM

Answers

  • catch the SoapException to get the detail.

    catch(System.Web.SoapException ex)

    {

       Console.WriteLine(ex.Detail.ToString());

    }

    InnerException will  not give u the exact error. "record is created"? despite exception,  it means there is some plugin  on Account(Post)? Are u sure, did you check  with plugin registration tool.


    Muhammad Ali Khan
    http://malikhan.wordpress.com
    Tuesday, June 1, 2010 6:50 PM

All replies

  • Can u  past your  full code,

    plus also try to catch the exception  like this to  get the full details.

    try

    {

    }catch(System.Web.SoapException ex)

    {

       Console.WriteLine(ex.Detail.ToString());

    }

    the above will give you the exact error.  Is there any plugin on  Account Entity(pre) that may be causing  this exception?


    Muhammad Ali Khan
    http://malikhan.wordpress.com
    Tuesday, June 1, 2010 5:59 PM
  •              try
                {
                    CrmService.account _account = new CrmService.account();
                    _account.name = "Magic Account";
                    Guid guid = crmService.Create(_account);
                }
                catch (Exception e)
                {
                    Console.Write(e.InnerException.Message.ToString());
                }

     

    1. I observed that record is created but the exception is raised at step "Guid guid = crmService.Create(_account);"

    2. No, I am not using any plugin on Account entity.

     

    Tuesday, June 1, 2010 6:35 PM
  • catch the SoapException to get the detail.

    catch(System.Web.SoapException ex)

    {

       Console.WriteLine(ex.Detail.ToString());

    }

    InnerException will  not give u the exact error. "record is created"? despite exception,  it means there is some plugin  on Account(Post)? Are u sure, did you check  with plugin registration tool.


    Muhammad Ali Khan
    http://malikhan.wordpress.com
    Tuesday, June 1, 2010 6:50 PM