Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Contact Replacement Event can be triggered using Custom Logic. The following parameters are Required to execute the Event.

Code Block
languagephp
titleContact Replacement
linenumberstrue
/**
* Event: System-wide Contact Replacement
* Listener Class: Application_Model_Contact_Contact
* Listener Method: eventReplaceContact
*/  

PCR_Event::attachDb(
    "replace-contact",
    ["Application_Model_Contact_Contact" => "eventReplaceContact"]
);

PCR_Event::trigger(
    "replace-contact",
 	[ 		
		"contact":   [      
        "contact" => "216121", 	    //RecID of Contact that initiated the replacement
		
        "contactRecid":
		[
			"216125" 			 =>
        [
            "216125"            //RecID of Contact that is replacing
  		      ],
		
        "replaceContactRecid":
		[
			"216121" 			 =>
        [
            "216121"            //RecID of Contact getting replacing
   		     ],
		        "comment": => "This is a comment",
		
        "deleteContact": => true,
		        "users_recid": => "1217",	   //RecID of User that initiated the replacement
 
    		    "eventBroadcastBy": => "216121",
		        "eventBroadcastTime": => "Oct 3, 2022, 2:47 pm",
		
        "eventBroadcastDayofWeek": => "1",
		
        "eventBroadcastHourMin": => "1447", 	 	
	       
    ]
);