You need to sign in to do that
Don't have an account?
SAHG-SFDC
Check/Unchk chk box on Parent Object
HI,
I am trying to check the chkbox on oppty if their are atleast one child record (Lookup relationship to custom object) , If all records attached to Oppty are deleted, this box should be unchecked.
Any suggestions?
I am trying to check the chkbox on oppty if their are atleast one child record (Lookup relationship to custom object) , If all records attached to Oppty are deleted, this box should be unchecked.
Any suggestions?
use the below code. (Assuming the checkbox field in opportunity is WithChild__c and the lookup field to opportunity is opportunity__c and the child relationship name is pobs__r )
Let me know if you have any issues.
Mark it as best answer if it works.
Regards
All Answers
use the below code. (Assuming the checkbox field in opportunity is WithChild__c and the lookup field to opportunity is opportunity__c and the child relationship name is pobs__r )
Let me know if you have any issues.
Mark it as best answer if it works.
Regards
create two custom fields , one to be a roll-up summary ( Count) on the related records, one to be a formula of type checkbox
IF(Rollup summary > 0,true,false)
replace Rollup summary with the name of the new field usually ending "__c"
advantage, no code
The other question would be , can they use code at all ( lower then enterprise edition ? )
If the record which has this chked (on custom object) is deleted or the stage for this record is changed from Approved to something else then unchk (chkbox2) on opportunity
Can This logic be in the same trigger as above? (This is the same custom object as above)
Many THANKS! :)
Regards
"HI,
I am trying to check the chkbox on oppty if their are atleast one child record (Lookup relationship to custom object) , If all records attached to Oppty are deleted, this box should be unchecked.
Any suggestions?"
No errors , and not working
How do we check if the parent actually has any child record? When I tried with the relatioship name it gave an error "Aliasing not allowed"
Flag is a boolean variable to know if there is any record satisfying your req.
Was it working before adding this second functionality?
Try this code and let me know
I am unable to check how to see if there are any child records, If there is atleast one check the box
Why are you using the relationship field? I think this is from line 47 correct? Apologize if its too silly just trying to get it together
Relationship field pobs__r is used to query all childs relatd to opportunities.
Any idea what we are missing ?