+ Start a Discussion
hari0853701703454959hari0853701703454959 

Field Update

Hi Everyone,
I have Custom object DSR is a detail object of Opportunity
-On the DSR object, when the Status = Cancelled transfer ownership or DSR record to related Opportunity Owner
thanks&regards
hari
OnpursuitOnpursuit
Is it a Master - Detail. Owner of Master will be the owner of Detail.

For Lookup, You can write a Trigger.
hari0853701703454959hari0853701703454959
hi, “Is it a Master - Detail. Owner of Master will be the owner of Detail. For Lookup, You can write a Trigger.” ya, its correct.how to write the trigger for this requirement..... Thanks hari Thanks&Regards *Hareesh.I*
OnpursuitOnpursuit
Write a trigger on DSR.

trigger updateowner {

List<DSR> own = [SELECT DSR__r.Opportunity.owner FROM DSR WHERE Trigger.new];
if( DSR.Status == Cancelled) //check the previous value too
 {
DSR__c.owner == own.Opportunity.owner
 } 
}

This is a bad example. But will show you how to do it.
hari0853701703454959hari0853701703454959
hi, I'm selected picklist value="cancelled" in DSRobjectowner is update and also automatically update on opportunity owner name thanks hari Thanks&Regards *Hareesh.I*