S.No | Component |
---|---|
Follow the order as mentioned below to create the components | |
Configuration | |
1 | Create New App App Label: Sample App Name Sample Note: Enable security for all the profiles. |
2 | Create New Custom Object Singular Label: Parent Plural Label: Parents Object Name: Parent Standard Field: Field Label Parent No: Data Type: Auto Number Display Format: P-{00000} |
3 | Create New Custom Object Singular Label: Child Plural Label: Childs Object Name: Child Standard Field: Field Label Child No: Data Type: Auto Number Display Format: C-{00000} |
- /* Description:
- * ============
- * Apex Trigger to delete the related child object records upon
- * deleting the parent object record in case of look up
- * relationship *
- * Author:
- * ========
- * www.srinusfdc.com
- */
- trigger ParentTrigger on Parent__c (before delete) {
- /*Assume that parent__c is a field api name( look up to parent object) in child object.*/
- delete [select id from Child__c where parent__c in: trigger.old];
- /*Note: trigger.old will be automatically converted to set of ids
- by salesforce (alternative: trigger.oldMap.keyset()).*/
- }
No comments:
Post a Comment