System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Account]: [Account]
I am trying to upsert a List of objects which has a Master-Detail relationship with Account. The objects being the Detail and Account is the master. I do not know how to even fill that Account field, but the field should match the account Id, for the account detail page I am on. Anyone know what is going on?
...
private void Data()
DetailList = [
SELECT Id, Name, Account__c
FROM Account_Detail__c LIMIT 900
];
public void Detail(){
Data();
Account_Detail__c j = new Account_Detail__c;
for(loops over a certain amount of times)
{
Account_Detail__c j = new Account_Detail__c();
j.name ='blank';
detailList.add(j);
}
upsert DetailList;
}
...