isatheeskumar / excel-connector

Automatically exported from code.google.com/p/excel-connector
0 stars 0 forks source link

Enhancement - Find person by name, email #40

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. none
2.
3.

What is the expected output? What do you see instead?
adds two utility functions to help find the ids of people (contacts,leads) in 
the org.

What version of the product are you using? On what operating system?  With
what Salesforce.com edition?
All

Please provide any additional information below.

Suggestion to add two more functions into the utils module

Function sfFindIdbyEmail(email_string, Optional findfirst)
  Dim sfId As String: sfId = "#N/F"
  sfId = sfSearch("Contact", email_string, "EMAIL", findfirst)
  If sfId = "#N/F" Then
    sfId = sfSearch("Lead", email_string, "EMAIL", findfirst)
  End If
  sfFindIdbyEmail = sfId
End Function
Function sfFindIdbyName(firstname, Optional lastname, Optional findfirst)
  Dim sfId As String: sfId = "#N/F"
  If IsMissing(lastname) Then
    Dim tmp() As String: tmp = Split(firstname, " ", 2)
    firstname = tmp(0)
    lastname = tmp(1)
  End If
  sfId = sfSearch("Contact", firstname & " " & lastname, "NAME", findfirst)
  If sfId = "#N/F" Then
    sfId = sfSearch("Lead", firstname & " " & lastname, "NAME", findfirst)
  End If
  sfFindIdbyName = sfId
End Function

Original issue reported on code.google.com by e...@hollebone.ca on 2 Aug 2011 at 9:03

GoogleCodeExporter commented 8 years ago
nice, will add in a future release

Original comment by vneh...@gmail.com on 30 Jan 2013 at 12:26