function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Michael SvachaMichael Svacha 

problem with flow from workbook

I'm working through the workbook to get familar with everything but keep coming up with an issue in the flow section. I am getting this error message. Can anyone help me please?

Sorry, an error occurred in the flow.

For help, provide your flow administrator with the following information: UPSERT --- UPSERT FAILED --- ERRORS : (REQUIRED_FIELD_MISSING) Required fields are missing: [Invoice__c] --- for SFDC record with ID : null,

Thank you
David "w00t!" LiuDavid "w00t!" Liu
The object has a required field Invoice__c that simply isn't being populated by your flow.  

You need to add a step in your flow to populate this field, or turn off the requirement on that object to have that field always populated!
Avinash AkondiAvinash Akondi
Hello Michael,

List<Account> accountsWithContacts = new List<Account>();
List<Account> accountsWithTenContacts = new List<Account>();
List<Account> accs = [SELECT Id, Name, (SELECT Id FROM Contacts) FROM Account];

for (Account a : accs) {
  if (a.Contacts != null && a.Contacts.size() > 0) {
    accountsWithContacts.add(a);
    if (a.Contacts.size() == 10) {
      accountsWithTenContacts.add(a);
    }
  }
}

Thanks,
AutoRabit
http://www.autorabit.com/