You need to sign in to do that
Don't have an account?
Silpi Roy 19
Apex code for duplicate
I am new to salesforce need help to write apex class for the following criteria:
There are three entry points for contact match:
ContactMatch
Read Input Parameters
Read External Parameters from category “ContactMatch” + Type (input parameter)
For each criteria row where there is non null contact data
Status = ContactSearch
Exit if match found
End Loop
If CreateContact = 1 and ContactId = “” and Status <> “Error” then
ContactCreate
End If
If Type = “InternationalPlayers” and ContactId <> “” and (Status = “Match” or “Duplicate”) then
Status = ContactUpdate
End If
PostMatchActions
Return ContactId, Status, IsMember, IsClubAffiliated, LoginName, ContactList
ContactMatchBatch
Invoked by Contact List Applet (Admin) via BC LTA Contact Administration where Type = “UI”
Or by workflow process “LTA Contact Match” where Type = “Batch”
Read Input Parameters
Query for contact search expression
Loop
Retrieve data fields from contact record
ContactMatch
End Loop
ContactMatchIO
Invoked by workflow “LTA PDS Publish Catalog Web Service” or “LTA Zendesk Query Contact Web Service”
Retrieve data fields for contact
ContactMatch
Thanks in advance
Inputs
Parameter | Optional | Comments |
Type | N | Name of the ruleset |
CreateContact | N | Create Contact 1 (Yes) 0 (No) if match not found |
ContactFirstName | N | First name |
ContactLastName | N | Last Name |
ContactHomePhone | N | Phone Number |
ContactTitle | N | Title |
ContactGender | N | Gender |
ContactDOB | N | Date of Birth |
ContactPostcode | N | Post Code |
ContactEmailAddress | N | Email Address |
ContactBTNumber | Y | BT Number |
ContactCoachCode | Y | Coach Code |
ContactATPId | Y | ATP Id |
ContactWTAId | Y | WTA Id |
ContactIpinId | Y | iPin Id |
ContactTEId | Y | TE Id |
ContactOfficialNumber | Y | Official Number |
Outputs
Parameter | Optional | Comments |
ContactRowId | N | Siebel Id of winning match if match found |
Status | N | NoMatch – no matches found Match – one match found Duplicate – duplicate matches found Error - error |
Username | N | Username of winning match |
IsMember | N | Is the winning match a BT member? |
IsClubAffiliated | N | Is the winning match affiliated to a venue? |
ContactList | Y | Search Expression of matching contacts in the format [Contact Id] = ‘X’ OR [Contact Id] = ‘Y’ |
Algorithm
There are three entry points for contact match:
- ContactMatch (match for given criteria and contact data)
- ContactMatchBatch (as above for for multiple contact records)
- ContactMatchIO (as contact match except input paramters are in an IO instead)
ContactMatch
Read Input Parameters
Read External Parameters from category “ContactMatch” + Type (input parameter)
For each criteria row where there is non null contact data
Status = ContactSearch
Exit if match found
End Loop
If CreateContact = 1 and ContactId = “” and Status <> “Error” then
ContactCreate
End If
If Type = “InternationalPlayers” and ContactId <> “” and (Status = “Match” or “Duplicate”) then
Status = ContactUpdate
End If
PostMatchActions
Return ContactId, Status, IsMember, IsClubAffiliated, LoginName, ContactList
ContactMatchBatch
Invoked by Contact List Applet (Admin) via BC LTA Contact Administration where Type = “UI”
Or by workflow process “LTA Contact Match” where Type = “Batch”
Read Input Parameters
Query for contact search expression
Loop
Retrieve data fields from contact record
ContactMatch
End Loop
ContactMatchIO
Invoked by workflow “LTA PDS Publish Catalog Web Service” or “LTA Zendesk Query Contact Web Service”
Retrieve data fields for contact
ContactMatch
Thanks in advance