abdul_rouf26 0 Unverified User

I am new in apex. I want to write a trigger in apex for before insert. I have to standard object (Contact, Opportunity).

SELECT sum(amount), Bussiness__c from opportunity where stagename='Closed Won' and id='006i000000Kt683AAB' group by Bussiness__c

I want when trigger runs this get sum(Amount) field and Bussiness__c value and then update Contact Total_Business__c with Sum(Amount) Value. Here Bussiness__C is contact id at opportunity object.

Thanks in advance and Waiting for your positive Response.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.