locked
Invalid object type when setting lead owner RRS feed

  • Question

  • I am trying to create a new lead from a website via the CRMSDK web service.

     

    I managed to create the lead, with the owner being the user that I am using to connect with.  I want the owner to be a user that I get from a security role.  I managed to extract the user from the security role but when I try to set the owner when I create a new lead I get a error back from the web service, the SOAP exception gives me the following:

     

    <detail>

    <error><code>0x8004023b</code>

    <description>Invalid Object Type: 4 provided on attribute: ownerid</description>  <type>Platform</type>

    </error>

    </detail>

     

    This is how I am trying to set the owner property:

    this.Ownerid = new Owner();

    this.ownerid.type = this.EntityName.ToString();

    this.ownerid.Value = id; (where id is the Guid from a system user in a security role)

     

    I then set the other properties in the lead object and then I pass the object to the create method in the service.

     

    I verified that the GUID is a valid Guid.

     

    Tuesday, April 8, 2008 11:09 AM

Answers

  • HenkBarnard,

     

    Change this:

    ........

    this.ownerid.type = this.systemuser.ToString();

    .........

     

    Cheers,

    Jim

    Tuesday, April 8, 2008 4:51 PM
    Moderator