In a salesforce project, I have an object called Project__c which I want to upsert. I have recently added a lookup to the Project__c object and now when I do an upsert project, the following error message is generated:
Field name provided, Project__c is not an External ID or indexed field for Project_Element__c.
NOTE: Project_Element holds a reference to Project, so I can do a query call WHERE ID =: currentProject.Id, so that I can display more than a single element and this error only occurs when there are no Project_elements with their projectID to the curentProject.
As I understand it, upsert will only look at a specific external ID field when it is told to do so. My upsert call looks like this:
Shouldn't it just look at the project Id?
I get the same error even if I call upsert like this:
upsert currentProject Id;