You need to sign in to do that
Don't have an account?
SalesforceA
Update Parent Text Field with Child "Name" values
I have a Parent object (Orders) with a Child object (States). The Child object is using the standard Name field as the "State" field.
I want to list all the UNIQUE states in a concatenated Text field on the Orders object.
My business allows for the same "State" to be related multiple times to the Parent but I only want to show each State one time in the text field that is populated by the trigger.
I'm a newbie when it comes to Triggers any help would be greatly appreciated!
I want to list all the UNIQUE states in a concatenated Text field on the Orders object.
My business allows for the same "State" to be related multiple times to the Parent but I only want to show each State one time in the text field that is populated by the trigger.
I'm a newbie when it comes to Triggers any help would be greatly appreciated!
All Answers
I'm getting an error on line 17 "loop variable must be an SObject or list of State__c"
Also. You need to make sure you put in the right field name/relationship so when you navigate to State object, click on the parent field (order__c) it shows what the relationship name is (my guess is its States) so its States__r
Can I bug you for one more tip? I need this to remove the State if they delete the related item. Sorry, I totally forgot to mention that earlier.
for(States__c s : trigger.isDelete ? trigger.old : trigger.new )
THANK YOU! THANK YOU! I've been struggling with this for days now!
Please help me understand the basics of writing triggers --
I have a question for you ... In this we are updatind child to parent ... is that the reason the we need to get the parent ids in set ??? at the begining only ???
if we update parent to child : only one inner query and nested for will work ??
Please guide . Reply Awaited
please help :-(