Answered by:
0x80040217 Contact With Id = xxxxxxxxxxx Does Not Exist Platform

Question
-
Hi,
I am getting the following error while inserting the Account (Type Customer) in to the contact.
0x80040217 Contact With Id = xxxxxxxxxxx Does Not Exist Platform //getting error in the statement service.create(cont)
The code is here
if ((AccountidCode.accountid != null))
{
_AccountId = AccountidCode.accountid.Value;
lookUp_Accountid.Value = _AccountId;
cont.parentcustomerid = lookUp_Accountid;
}Thanks,
Srikanth Reddy
- Edited by Srikanth_MSCRM Monday, September 26, 2011 5:57 PM
Monday, September 26, 2011 5:46 PM
Answers
-
Strange, what about this:
Customer customer = new Customer(); customer.type = "account"; customer.Value = new GUID("5ad5b095-aee7-e011-9765-005056be0007");
Gonzalo | gonzaloruizcrm.blogspot.com
- Proposed as answer by Gonzalo Ruiz RModerator Monday, September 26, 2011 6:58 PM
- Marked as answer by Jim Glass Jr Monday, September 26, 2011 8:09 PM
Monday, September 26, 2011 6:57 PMModerator
All replies
-
Where are you getting the ID of the contact from? The problem seems to be with the contact, not the account.
Gonzalo | gonzaloruizcrm.blogspot.com
Monday, September 26, 2011 6:28 PMModerator -
Hi,
I am creating the new contact record with account (Type-Customer).
Thanks,
Srikanth Reddy
Monday, September 26, 2011 6:32 PM -
I see. So where are you initiating the lookUp_Accountid?
You need to make sure that the lookup is referencing an Account and not a Contact
Gonzalo | gonzaloruizcrm.blogspot.com
Monday, September 26, 2011 6:33 PMModerator -
Hi,
here is the code, Make sure that I am creating the new contact record and parent account is there.
contact cont = new contact();
Customer lookUp_Accountid = new Customer();lookUp_Accountid.Value =new GUID("5ad5b095-aee7-e011-9765-005056be0007");
cont.parentcustomerid = lookUp_Accountid;service.Create(cont);//here I am getting the error.
Thanks,
Srikanth Reddy
- Edited by Srikanth_MSCRM Monday, September 26, 2011 6:44 PM
Monday, September 26, 2011 6:42 PM -
I see. You must specify the type of customer:
Customer lookUp_Accountid = new Customer("account", new GUID("5ad5b095-aee7-e011-9765-005056be0007"));
Gonzalo | gonzaloruizcrm.blogspot.com
- Proposed as answer by Gonzalo Ruiz RModerator Monday, September 26, 2011 6:48 PM
Monday, September 26, 2011 6:48 PMModerator -
Hi,
I am getting the below error.
CRMServiceProvider.CRM.WebService.Customer' does not contain a constructor that takes '2' arguments
Thanks,
Srikanth Reddy
Monday, September 26, 2011 6:52 PM -
Strange, what about this:
Customer customer = new Customer(); customer.type = "account"; customer.Value = new GUID("5ad5b095-aee7-e011-9765-005056be0007");
Gonzalo | gonzaloruizcrm.blogspot.com
- Proposed as answer by Gonzalo Ruiz RModerator Monday, September 26, 2011 6:58 PM
- Marked as answer by Jim Glass Jr Monday, September 26, 2011 8:09 PM
Monday, September 26, 2011 6:57 PMModerator -
Thanks a lot , Now it is working fine.Monday, September 26, 2011 7:02 PM
-
Glad to help! Please mark as answered if it solved your problem ;-)
Gonzalo | gonzaloruizcrm.blogspot.com
Monday, September 26, 2011 7:03 PMModerator