locked
Create account - 0x8004022c Data out of range RRS feed

  • Question

  • Hi,

    I am trying create an account/organisation on  Dynamics / MSCRM 3.0 via the web service.

    Like so:

       public void CreateAccount(account account)     

                  account.accountid = new Key { Value = this.crmService.Create(account) };     

    }

    I have caught the SoapException and the inner details says -  -

    <error>\n<code>0x8004022c</code>\n<description>Data out of range</description>\n<type>Platform</type>\n</error>

    My account object is empty apart from a few address lines, and a company name.



    Does anyone know what the problem is?

    Thanks very much



    Wednesday, April 3, 2013 6:10 PM

Answers

  • I don't think that could cause a 'Data out of range' exception, unless you're passing an empty guid, which might cause this exception.

    It's more likely that one of the other fields is causing the problem. I'd start by removing all fields apart from the name (and ensuring that is not too long), to see if that's OK.

    It's also possible that you may have a plugin on the create event of the account entity which could cause the error


    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    • Marked as answer by MrKevorkian Wednesday, April 24, 2013 3:39 PM
    Thursday, April 4, 2013 12:47 PM
    Moderator

All replies

  • If you are trying to create a new account, leave the accountid attribute null. This will be auto-generated upon service.create(account). You do not need to set the value of accountid manually.

    After settings the name and address lines simply write

    Guid id = service.create(account)

    the id returned will be the id assigned to the accountid attribute. You can use this id elsewhere if you want. If you do not have any further use of it, just ignore that return value.

    HTH

    Sam


    Dynamics CRM MVP | Inogic | http://inogic.blogspot.com| news at inogic dot com

    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    • Proposed as answer by Sam - Inogic Thursday, April 4, 2013 3:24 AM
    Thursday, April 4, 2013 3:24 AM
  • Hi,

    Thanks for your comments.

    Do you think this would cause the Data out of range exception?

    Thanks

    Thursday, April 4, 2013 11:07 AM
  • I don't think that could cause a 'Data out of range' exception, unless you're passing an empty guid, which might cause this exception.

    It's more likely that one of the other fields is causing the problem. I'd start by removing all fields apart from the name (and ensuring that is not too long), to see if that's OK.

    It's also possible that you may have a plugin on the create event of the account entity which could cause the error


    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    • Marked as answer by MrKevorkian Wednesday, April 24, 2013 3:39 PM
    Thursday, April 4, 2013 12:47 PM
    Moderator
  • Thanks I will try that.
    Friday, April 5, 2013 9:20 AM