You need to sign in to do that
Don't have an account?
HelloSan
i have account and year fields on opportunity object when i insert new child Service(Custom Object)to opportunity object i need to cross check whether there are any childs for that account and year before inserting new child,i need apex code for this
child object name is concatenation of account and year.
{
//Here I need to get opp year and account where these fields are common for Opportunity and Service
list<Service__c> slist=[SELECT id,name from Service Where year == opp.year and accountid == opp.accountid ];
}
if(slist.size() ==0)
{
insert service;
}
else
{
update service;
}