You need to sign in to do that
Don't have an account?
balraj singh 33
displaying null for system.debug(accountids) but accountid has value
list<id> accountids;
for(contact con1 : [select id,accountid From contact where lastname = 'TEST'and birthdate = 2019-04-15 and firstname = 'TEST'])
{
system.debug(con1.accountid);
}
system.debug(accountids);
for(contact con1 : [select id,accountid From contact where lastname = 'TEST'and birthdate = 2019-04-15 and firstname = 'TEST'])
{
system.debug(con1.accountid);
}
system.debug(accountids);
Greetings to you!
You need to add values to accountids list. Please try below code:
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas
Firstly keep the Id in the Set and ensure that this contact has Account as a parent, if yes then try the below code it is working for me: I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi