You need to sign in to do that
Don't have an account?
K_dev
execution of AfterUpdate caused Invalid field Ownerid for SObject Call_List__c
Developer script exception createopp : createopp: execution of AfterUpdate caused by: line 31, column 35: trigger body is invalid and failed recompilation: Invalid field Ownerid for SObject Call_List__c
Apex script unhandled trigger exception by user/organization: 005800000057Bpj/ 00D80000000PQ4F
createopp: execution of AfterUpdate
caused by: line 31, column 35: trigger body is invalid and failed recompilation: Invalid field Ownerid for SObject Call_List__c
createopp: execution of AfterUpdate
caused by: line 31, column 35: trigger body is invalid and failed recompilation: Invalid field Ownerid for SObject Call_List__c
can anyone please let me know ?
can you please put your trigger code here?
Check the field OwnerID for that object and it is better if you share your code to analyze it better.
If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.
Thanks
trigger createopp on Call_List__c (after update)
{
List<opportunity> opps=new List<opportunity>();
Set<String> callIds = new Set<String>();
for(Call_List__c ca:Trigger.New)
{
// after update
if(Trigger.IsUpdate && ca.Qualified_status__c!=Trigger.oldMap.get(ca.Id).Qualified_status__c && ca.Qualified_status__c=='converted'&&ca.Converted_to_Opportunity__c==false)
{
opportunity o=new Opportunity();
O.Name=ca.Account__c - ca.;
o.Accountid = ca.Account__c;
o.Product_Id__c=ca.Product__c;
o.StageName = 'Open';
o.CloseDate= Date.Today();
o.LeadSource = 'Abandon List';
o.Secondary_User__c = ca.Ownerid;
//QueueSobject que = [Select Id, Queue.Id From QueueSobject Where Queue.DeveloperName='calllist_queue' Limit 1];
o.Ownerid = ca.Sales_User__c;
o.Converted_to_Opportunity__c=true;
callIds.add(ca.Id);
opps.add(o);
system.debug('opportunity is '+o);
}
//update ca;
}
List<Call_List__c> callLists = new List<Call_List__c>();
for(Call_List__c call : [select Converted_to_Opportunity__c from Call_List__c where Id in :callIds])
{
call.Converted_to_Opportunity__c = true;
callLists.add(call);
}
if(callLists.size() > 0)
{
update callLists;
}
if(!opps.IsEmpty())
{
system.debug('********entered if');
try
{
insert opps;
}
catch(Exception e)
{
system.debug('******exception thrown'+e);
}
}
}
There must be no field called OwnerId in teh object Call_List__c. Please check that.
Is this a detail object of Opportunity(Master-Detail)? Then the opportunity owner will be its owner. No field will be there called OwnerId.
If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.
Thanks