You need to sign in to do that
Don't have an account?
jwickett
Check if row has any child records
Hi guys,
How do I check if an object's row has any related child records when the child records point to the master object? What is the best solution to tackle this problem (Apex, validation rules, etc...)? For example, I want a custom object called "musicians", and I want to assign a type of music to each musician (ie- "country", "rock", etc... all of which are stored as rows in another custom object). Before each musician enters an approval process, how would i check to see if in fact a type of music has already been assigned to the musician if the type of musician object is storing the ID of the musician it refers to?
I guess what i'm trying to figure out is if a master object (like musicians) is considered "updated" after a child object (like type of music) relates to it.
Thanks in advance,
Justin
Message Edited by jwickett on 07-27-2008 09:08 PM
How do I check if an object's row has any related child records when the child records point to the master object? What is the best solution to tackle this problem (Apex, validation rules, etc...)? For example, I want a custom object called "musicians", and I want to assign a type of music to each musician (ie- "country", "rock", etc... all of which are stored as rows in another custom object). Before each musician enters an approval process, how would i check to see if in fact a type of music has already been assigned to the musician if the type of musician object is storing the ID of the musician it refers to?
I guess what i'm trying to figure out is if a master object (like musicians) is considered "updated" after a child object (like type of music) relates to it.
Thanks in advance,
Justin
Message Edited by jwickett on 07-27-2008 09:08 PM
I ended up just associating an Apex trigger with the child object, such that now when the child object is inserted, updated, deleted, or undeleted, i update the parent's information from the child object and update the parent accordingly.
Message Edited by jwickett on 07-30-2008 03:49 PM