You need to sign in to do that
Don't have an account?
Shivkumar Shete
Compile Error: Variable does not exist
trigger CloneOpp on Opportunity( after insert, after update ) { Set<String> fields = Opportunity.getSobjectType().getDescribe().fields.getMap().keySet(); Map<Id,opportunity_clone__c> co2 = new Map<Id,Opportunity_clone__c>(); for(Opportunity record: Trigger.new) { co2.put(record.opportunity_clone__c,new opportunity_clone__c(id=record.opportunity_clone__c)); for(String field:fields) { if(field.indexOf('__c')>-1) { // This is a custom field. try { Opportunity_clone__c.get(record.opportunity_clone__c).put(field,record.getSObject(field)); } catch(exception e) { /* NOTE: This just means copy failed. */ } } } } update co2.values(); }
Can you please let us know on which line you are getting error
I'm getting error on line no 6 &10 i.e.Variable does not exist
I'm not clear about your answer could you explain in detail
Please try once below code :
Hope this helps you!
If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others.
Thanks
Varaprasad
@For Support: varaprasad4sfdc@gmail.com
It's not working giving lots of errors