You need to sign in to do that
Don't have an account?
Asif Khan 44
Delete records from 2 unrelated objects
I have 2 objects A and B each having a phone number field. the Mobile number field of Object A automatically gets updated in the phone number field in Object B.Now I want that all the records in B should be deleted if its matching record(phone Number) isnt found in Object A.
Object A ---> mobile number
Object B --> phone number
please note : I want the deletion of the orphan records of B working in a trigger
A Query to deal with this conundrum would be helpful and much appreciated
Thanks
Object A ---> mobile number
Object B --> phone number
please note : I want the deletion of the orphan records of B working in a trigger
A Query to deal with this conundrum would be helpful and much appreciated
Thanks
You can run one time script, if you have a lot of orphan records in B - then, you can write trigger on B, on UPDATE, you can check whether record in present in Object A or not, If not you can delete the record.
All Answers
You can run one time script, if you have a lot of orphan records in B - then, you can write trigger on B, on UPDATE, you can check whether record in present in Object A or not, If not you can delete the record.
well , what you said is correct , but the situation m faced with right now is that there was some dummy data along with real data in Object B, now I wish to delete those dummy data using this logic that if the phone field in OBject A does not match with the mobile field in Object B , then those records should be deleted in Object B