You need to sign in to do that
Don't have an account?
Nilesh Mane
How can I get Account ID?
I want to send an email to all contacts which belongs to a single account.
I want to get their corresponding Account ID in batch apex dynamically.
How can I get Account ID?
Can you clarify your use case a little? Are you planning to iterate all accounts and send an email to all contacts associated with the account? If so, it sounds like you'll be using batch apex with a querylocator that pulls back all accounts. Your execute method will then be passed a list of accounts, and you can iterate these and pull back the contacts.
Note though, that there are limits on the amount of emails that you can send on a daily basis.
All Answers
If you have the contact records, they have a standard field populated with the account id named 'AccountId'.
Thanks for reply.
I want process apex job for a single Account at a time.
How will compiler know for which account i am running the job? plz help.
Can you clarify your use case a little? Are you planning to iterate all accounts and send an email to all contacts associated with the account? If so, it sounds like you'll be using batch apex with a querylocator that pulls back all accounts. Your execute method will then be passed a list of accounts, and you can iterate these and pull back the contacts.
Note though, that there are limits on the amount of emails that you can send on a daily basis.