function readOnly(count){ }
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 UpdateAccountAmount on Account(Before update) { for(Account Accnt:Trigger.New) { for(Opportunity CurrOpp :[Select Amount from Opportunity where Accountid=:Accnt.id]) { Accnt.Amount__c=CurrOpp.Amount; } } }
You have to query on opportunity with where condition as ' Opportunity.Accountid = Accountid ". Here Accountid is your current account id and get the relevant opportunity.
Then update opportunity as opp.ammount = acc.ammount.
Thanks,
Vyankatesh
use below code
if Amount__c is text field replace below code
Accnt.Amount__c=strin.valueof(CurrOpp.Amount);
Hope this will help you,
Mark Solved if its work for you.
Thanks
karthik
mark it best answer if its workd for you.. to help others for same issue.