You need to sign in to do that
Don't have an account?
magda
INVALID_FIELD, More than 1 field provided in an external foreign key reference in entity
Hi Every Body,
i try to insert a new Object having to other objects
Job application having candidate and position.
insert Canidate and insert Position is not a problem, but wenn i want to insert a job application i become this failure:
Insert failed. First exception on row 0; first error: INVALID_FIELD, More than 1 field provided in an external foreign key reference in entity: Position__c
My code is this one:
Thanks for your help
Magda
i try to insert a new Object having to other objects
Job application having candidate and position.
insert Canidate and insert Position is not a problem, but wenn i want to insert a job application i become this failure:
Insert failed. First exception on row 0; first error: INVALID_FIELD, More than 1 field provided in an external foreign key reference in entity: Position__c
My code is this one:
Code:
public Candidate__c getCandidate() { if(candidate == null) candidate = new Candidate__c(); return candidate; } public Position__c getPosition() { if(position == null) position = new Position__c(); return position; } public Job_Application__c getJobappl() { if(jobappl == null) jobappl = new Job_Application__c(); return jobappl; } public PageReference save() { jobappl.candidate__r = candidate; jobappl.position__r = position; insert position; insert candidate; insert jobappl; }
Thanks for your help
Magda
You need to insert the candidate record before you can reference it. Something like:
Thx very much it is runnung :)