Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
trigger Contacttrigger on Contact (After Insert) { Set<Id> setAccIds = new Set<Id>(); if(Trigger.isInsert){ if(trigger.isAfter){ for(Contact con : Trigger.new){ if(con.AccountId != null){ setAccIds.add(con.AccountId); } } } } for(Account acc :[Select id,Description ,(Select id,name from contacts) from Account where Id in : setAccIds]){ String s =''; for(Contact Con :acc.contacts){ s+=Con.Name +','; } acc.Description = s.removeEnd(','); acclist.add(acc); } if(acclist.size()>0){ update accList; } }
list<quote__c> quoteList = [select id,opportunityId,number__c,version__c from quote__c where opportunityId != null]; set<id> oppIdSet = new set<id>(); for(quote__c quoteObj :quoteList ){ oppIdSet.add(quoteObj.opportunityId ); } map<id,opportunity> oppmap = new map<id,Opportunity>( [select id , number__c , version__c from Opportunity where id In: oppIdset]); for(quote__c quoteObj :quoteList ){ if(oppmap.containsKey(quoteObj.opportunityId){ opportunity oppObj = oppmap.get(quoteObj.opportunityId); oppObj.number__c = quoteObj.number__c ; oppObj.version__c = quoteObj.version__c ; oppmap.put(quoteObj.opportunityId,oppObj ); } } update oppmap.values();
Try Below Trigger Please Mark It As Best Answer If It Helps
Thank You!
Quote Opportunity
number number
version version
primary field on quote must be checked .
please try this approach
If you find your Solution then mark this as the best answer.
Thank you!
Regards,
Suraj Tripathi