The Contact Replacement Event can be triggered using Custom Logic. The following parameters are Required to execute the Event.
Code Block |
---|
language | php |
---|
title | Contact Replacement |
---|
collapselinenumbers | true |
---|
|
/**
* Event: System-wide Contact Replacement
* Listener Class: Application_Model_Contact_Contact
* Listener Method: eventReplaceContact
*/
{
"contact":"216121",
PCR_Event::attachDb(
"replace-contact",
["Application_Model_Contact_Contact" => "eventReplaceContact"]
);
PCR_Event::trigger(
"replace-contact",
[
"contact" => "216121", //RecID of Contact that initiated the replacement
"contactRecid":[
=>
[
"216125" //ReciDRecID of Department getting replaced
],
"replaceContactRecid":[
"216121" Contact that is replacing
],
"replaceContactRecid" =>
[
"216121" //RecID of Department that is replacing
],
"comment":"5",
"deleteContact":true,
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",
} ]
); |