why can't you setup a Contact List where Account Name = X,Y,Z ?
Good that you got the button working.
I think your current issue is that the 'selected lead ids' for the account are not being correctly passed to Send_Marketo_Email apex code.
You are passing an array here as I circled here.
1> Is this array populated with the lead ids of all the leads on that account? Can you try debugging that it is indeed populated. The error might be due to the apex code not getting any values there.
2> I believe that the apex code does not like 'an array' as a querystring parameter. I think this might be your issue here. You will need to generate a 'comma separated list of all the lead ids on that account' and pass it here.
Hope this helps. Please feel free to reach out if you need help in getting this done.
Hi Rajesh Talele I have debugged this it turned out we are already passing a comma separated list of all the lead ids on that accounts. We can't see what is going on after we click the "Send Marketo Email" button. It says that it a managed package. Any ideas?
Yes. Debugging SFDC managed packages is tricky as we can not see the debug logs of the managed package.
Before performing this operation, can you please open the SFDC “Developer Console“. Once you are done, check the logs if anything useful shows up in the console?
That might help hopefully.
Also, does this functionality work on any other similar object like Contact List for you?