You need to sign in to do that
Don't have an account?
Peter Mitchell
SOAP API:Can't create a record due to "not an External ID or indexed field" error
I'm new to SalesForce and new to using the SOAP API to create a record. I am trying to create a Case and link it to an Account, but nothing I have tried has worked yet. Error received:
"ERROR creating record: Field name provided, Id is not an External ID or indexed field for Account"
I have read the documentation on "create() and Foreign Keys" and followed the example code. (This is in Java.) As far as I can tell the Account Id field is what is used to link the Case to the Account. If I query the Case for Case.AccountId equal to the value in Account.Id I get a list of Case records. But when I try to create a Case with the Account Id I get the error shown.
I have used describeSObjects() to look at all the fields in Account and Case, but I don't see anything that indicates external id or index. I thought that if the Case records are already linked by Account Id then it would be set, but that is not seeming to be true. How can I find this out?
Thanks,
Peter
"ERROR creating record: Field name provided, Id is not an External ID or indexed field for Account"
I have read the documentation on "create() and Foreign Keys" and followed the example code. (This is in Java.) As far as I can tell the Account Id field is what is used to link the Case to the Account. If I query the Case for Case.AccountId equal to the value in Account.Id I get a list of Case records. But when I try to create a Case with the Account Id I get the error shown.
I have used describeSObjects() to look at all the fields in Account and Case, but I don't see anything that indicates external id or index. I thought that if the Case records are already linked by Account Id then it would be set, but that is not seeming to be true. How can I find this out?
Thanks,
Peter
All Answers
ERROR creating record: Unable to create/update fields: AccountId. Please check the security settings of this field and verify that it is read/write for your profile or permission set.
When I look at Field Accessibility under Security Controls I don't see AccountId as one of the fields. How can I verify and set it if it doesn't show in list?
Also, from the documentation and sample code I got the impression that to set the AccountId I needed to create an Account object with the ID field set and then add the Account to the Case. The problem there is that it says the field is not external or not indexed.
Any other ideas?