You need to sign in to do that
Don't have an account?
Dhana t 1
How to Updating child value to its parent object when its checked ?
HI.. I have scenario that i have Master-detailed object , in child object when i checked the check box ,associated textfield will be hilated and then enter the value in textfield, the the value of textfield must be updated in parent field...
plz help me how to write code for this...
plz help me how to write code for this...
In a M-D Relationship, there can be multiple ObjectX records related to a single Account record. This means if you have 2 ObjectX records, both have this textfield field and the Account only has a single textfield field. Systematically, Salesforce does not know which ObjectX record to pull the value from.
If that's the case, you should be using a lookup instead of a M-D relationship.
If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others and improve the overall quality of Discussion Forums.
Gaurav Kheterpal
Certified Force.com Developer| Salesforce Mobile Evangelist| Developer Forums Moderator| Dreamforce Speaker
i want it programatically either in apex or vf pages, this requirement is in workflow like field update from child to parent...
Trigger will be run after insert ,after update, and after delete.
This is the pseudo code:
for (childobj c : trigger.new)
{
if (c.checkboxfield = true)
{
masterobj m = {select id from masterobj where id = :c.masterid}
m.statusfield = ".......";
}
}