In our scenario. when ever a customer calls i'll create Contact first then Opportunity.
I wrote a workflow to auto fetch customer name and phone number from Contact module.
So the user agents will only enter the required details when creating Opportunity from Contact bottom panel. But in this scenario duplicate check is not working.
API before save script is running but phone number will only fetch after opportunity got created. Howe can i resolve this issue?
API Before Save Script :-
if (!recordService\skipDuplicateCheck()) {
if (entity\isNew() || entity\isAttributeChanged('phoneNumber')) {
$id = record\findOne('Opportunity', null, null, 'phoneNumber=', phoneNumber);
if ($id) {
recordService\throwDuplicateConflict($id);
}
}
}
I wrote a workflow to auto fetch customer name and phone number from Contact module.
So the user agents will only enter the required details when creating Opportunity from Contact bottom panel. But in this scenario duplicate check is not working.
API before save script is running but phone number will only fetch after opportunity got created. Howe can i resolve this issue?
API Before Save Script :-
if (!recordService\skipDuplicateCheck()) {
if (entity\isNew() || entity\isAttributeChanged('phoneNumber')) {
$id = record\findOne('Opportunity', null, null, 'phoneNumber=', phoneNumber);
if ($id) {
recordService\throwDuplicateConflict($id);
}
}
}
Comment