No Results
Search Tips:
- Please consider misspellings
- Try different search keywords
Lead
見込みの、または潜在的な Opportunity を表します。
サポートされているコール
create()、delete()、describeLayout()、describeSObjects()、getDeleted()、getUpdated()、merge()、query()、retrieve()、search()、undelete()、update()、upsert()
項目
| 項目 | 詳細 |
|---|---|
| Address |
|
| AnnualRevenue |
|
| City |
|
| CleanStatus | |
| Company |
|
| CompanyDunsNumber | |
| ConnectionReceivedId | |
| ConnectionSentId | |
| ConvertedAccountId |
|
| ConvertedContactId |
|
| ConvertedDate |
|
| ConvertedOpportunityId |
|
| Country |
|
| CountryCode |
|
| CurrencyIsoCode |
|
| Description |
|
| Division |
|
|
|
| EmailBouncedDate |
|
| EmailBouncedReason |
|
| Fax |
|
| FirstName |
|
| HasOptedOutOfEmail |
|
| Industry |
|
| IsConverted |
|
| IsDeleted |
|
| IsUnreadByOwner |
|
| Jigsaw |
|
| LastActivityDate |
|
| LastName |
|
| LastReferencedDate |
|
| LastViewedDate |
|
| 緯度 | |
| 経度 | |
| LeadSource |
|
| MasterRecordId |
|
| MiddleName |
|
| MobilePhone |
|
| Name |
|
| NumberOfEmployees |
|
| OwnerId |
|
| PartnerAccountId | |
| Phone |
|
| PhotoUrl |
|
| PostalCode |
|
| Rating |
|
| RecordTypeId |
|
| Salutation |
|
| State |
|
| StateCode |
|
| Status |
|
| Street |
|
| Suffix |
|
| Title |
|
| Website |
|
変換済みのリード
リードが Account、Contact、Opportunity (オプション) に変換されたことを示す特別な状況があります。クライアントアプリケーションは、convertLead() コールを使用してリードを変換することができます。また、ユーザはユーザインターフェースを使用してリードを変換することもできます。リードが変換されると、参照のみになります。変換されたリードは、更新または削除できません。ただし、変換されたリードレコードをクエリすることはできます。
リードには、変換された状況を示すいくつかの項目があります。これらの項目は、ユーザインターフェースでリードを変換する場合に設定されます。
- ConvertedAccountId
- ConvertedContactId
- ConvertedDate
- ConvertedOpportunityId
- IsConverted
- Status
未読のリード
リードには、リード所有者が参照していないまたは編集していないことを示す特別な状況があります。ユーザインターフェースでは、ユーザが割り当てられているがまだ処理されていないリードを知っておくことは役に立ちます。リード所有者がまだリードを参照も編集もしていない場合、IsUnreadByOwner 項目が true になります。リード所有者がリードを少なくとも一度は参照または編集している場合は false となります。
リード状況選択リスト
Status の値は、ユーザインターフェースで定義されているように、リード状況選択リストの変換された状況または変換されていない状況に対応します。選択リストでリードの状況値を取得するには、クライアントアプリケーションは、LeadStatus をクエリできます。
API によって、Status をリードが変換済みであることを示す状況値のいずれかに変更して、リードを変換することはできません。評価済みリードを取引先、取引先責任者、商談に変換する際に、リードに対して、変換済みであることを示す状況のタイプを 1 つ選択できます。こうしたタイプを割り当てられたリードは、レポートに含めることはできますが、[リード] タブには表示されなくなります。
使用方法
リードを更新する、または convertLead() を使用して変換するには、リードに対する「編集」権限でクライアントアプリケーションにログインしている必要があります。
リードを作成、更新、または更新/挿入すると、クライアントアプリケーションは、ユーザインターフェースで設定された割り当てルールに基づいて、リードを 1 つ以上の User レコードに自動的に割り当てることができます。
この機能を使用するために、クライアントアプリケーションは、create または update で使用する AssignmentRuleHeader に次のオプションのいずれか (両方ではない) を設定する必要があります。
Java のサンプル
次の Java のサンプルでは、新しく作成されたリードを自動的にどのように割り当てるかを示しています。
1swfobject.registerObject("clippy.codeblock-0", "9");package com.doc.samples;
2import java.net.MalformedURLException;
3import java.net.URL;
4import java.rmi.RemoteException;
5import javax.xml.rpc.ServiceException;
6
7import com.sforce.soap.enterprise.LoginResult;
8import com.sforce.soap.enterprise.QueryResult;
9import com.sforce.soap.enterprise.SaveResult;
10import com.sforce.soap.enterprise.SforceServiceLocator;
11import com.sforce.soap.enterprise.SoapBindingStub;
12import com.sforce.soap.enterprise._AssignmentRuleHeader;
13import com.sforce.soap.enterprise._SessionHeader;
14import com.sforce.soap.enterprise.fault.LoginFault;
15import com.sforce.soap.enterprise.fault.UnexpectedErrorFault;
16import com.sforce.soap.enterprise.sobject.Lead;
17import com.sforce.soap.enterprise.sobject.SObject;
18
19public class LeadAssignment
20{
21
22 static LeadAssignment _leadAssignment;
23
24 public static void main(String[] args)
25 {
26 _leadAssignment = new LeadAssignment();
27 try {
28 _leadAssignment.CreateLead();
29 } catch (Exception e) {
30 e.printStackTrace();
31 }
32 }
33
34 public void CreateLead() throws UnexpectedErrorFault, LoginFault,
35 RemoteException, ServiceException
36 {
37 //Create the proxy binding and login
38 SoapBindingStub binding = (SoapBindingStub) new SforceServiceLocator().getSoap();
39 LoginResult lr = binding.login("user@domain.net", "secret");
40
41 //Reset the binding to use the endpoint returned from login
42 binding._setProperty(SoapBindingStub.ENDPOINT_ADDRESS_PROPERTY,
43 lr.getServerUrl());
44
45 //Create the session id header, and add it to the proxy binding
46 _SessionHeader sh = new _SessionHeader();
47 sh.setSessionId(lr.getSessionId());
48 binding.setHeader(
49 new SforceServiceLocator().getServiceName().getNamespaceURI(),
50 "SessionHeader", sh );
51
52 //Create a new case and assign various properties
53 Lead lead = new Lead();
54
55 lead.setFirstName("Joe");
56 lead.setLastName("Smith");
57 lead.setCompany("ABC Corporation");
58 lead.setLeadSource("API");
59 //The lead assignment rule will assign any new leads that
60 //have "API" as the LeadSource to a particular user
61
62 //Create the assignment rule header and add it to the proxy binding
63 _AssignmentRuleHeader arh = new _AssignmentRuleHeader();
64
65 //In this sample we will look for a particular rule and if found
66 //use the id for the lead assignment. If it is not found we will
67 //instruct the call to use the current default rule. You can't use
68 //both of these values together.
69 QueryResult qr = binding.query("Select Id From AssignmentRule where Name = " +
70 "'Mass Mail Campaign' and RuleType = 'leadAssignment'");
71 if (qr.getSize() == 0) {
72 arh.setUseDefaultRule(new Boolean(true));
73 } else {
74 arh.setAssignmentRuleId(qr.getRecords(0).getId());
75 }
76
77 binding.setHeader(
78 new SforceServiceLocator().getServiceName().getNamespaceURI(),
79 "AssignmentRuleHeader", arh);
80
81 // Every operation that results in a new or updated case, will
82 // use the specified rule until the header is removed from the
83 // proxy binding.
84 SaveResult[] sr = binding.create(new SObject[] {lead});
85 for (int i=0;i<sr.length;i++) {
86 if (sr[i].isSuccess()) {
87 System.out.println("Successfully created lead with id of: " +
88 sr[i].getId().getValue() + ".");
89 }
90 else {
91 System.out.println("Error creating lead: " +
92 sr[i].getErrors(0).getMessage());
93 }
94 }
95
96 // This call effectively removes the header, the next lead will
97 // be assigned to the default lead owner. Remember to add the
98 // session header back in.
99 binding.clearHeaders();
100 binding.setHeader(
101 new SforceServiceLocator().getServiceName().getNamespaceURI(),
102 "SessionHeader", sh);
103
104 }
105}C# のサンプル
次の C# のサンプルでは、新しく作成されたリードを自動的にどのように割り当てるかを示しています。
1swfobject.registerObject("clippy.codeblock-1", "9");using System;
2using System.Collections.Generic;
3using System.Text;
4using LeadAssignment.sforce;
5
6namespace LeadAssignment
7{
8 class LeadAssignment
9 {
10 private SforceService binding;
11
12 private static readonly string Username = "ENTERUSERNAME";
13 private static readonly string Password = "ENTERPASSWORD";
14
15 /// <summary>
16 /// Create the proxy binding and login
17 /// </summary>
18 private LeadAssignment()
19 {
20 this.binding = new SforceService();
21 LoginResult lr = binding.login(LeadAssignment.Username, LeadAssignment.Password);
22
23 // Reset the binding to use the endpoint returned from login
24 this.binding.Url = lr.serverUrl;
25
26 // Create the session ID header and add it to the proxy binding
27 this.binding.SessionHeaderValue = new SessionHeader();
28 this.binding.SessionHeaderValue.sessionId = lr.sessionId;
29 }
30
31 [STAThread]
32 static void Main(string[] args)
33 {
34 LeadAssignment leadAssignment = new LeadAssignment();
35 try
36 {
37 leadAssignment.CreateLead();
38 }
39 catch (Exception e)
40 {
41 Console.WriteLine(e.Message);
42 Console.WriteLine(e.StackTrace);
43 Console.WriteLine(e.InnerException);
44 }
45 }
46
47 public void CreateLead()
48 {
49 // Create a new Lead and assign various properties
50 Lead lead = new Lead();
51
52 lead.FirstName = "John";
53 lead.LastName = "Brown";
54 lead.Company = "ABC Corporation";
55 lead.LeadSource = "Advertisement";
56 // Setting the lead source for a pre-existing lead assignment rule. This
57 // rule was created outside of this sample and will assign any new leads
58 // that have "Advertisement" as the LeadSource to a particular user
59
60 // Create the assignment rule header and add it to the proxy binding
61 AssignmentRuleHeader arh = new AssignmentRuleHeader();
62
63 // In this sample we will look for a particular rule and if found
64 // use the id for the lead assignment. If it is not found we will
65 // instruct the call to use the current default rule. Both these
66 // values can't be used together.
67 QueryResult qr = binding.query("Select Id from AssignmentRule where Name = " +
68 "'Mass Mail Campaign' and SobjectType = 'lead'");
69 if (qr.size == 0)
70 {
71 arh.useDefaultRule = true;
72 }
73 else
74 {
75 arh.assignmentRuleId = qr.records[0].Id;
76 }
77 binding.AssignmentRuleHeaderValue = arh;
78
79 // Every operation that results in a new or updated lead will use the
80 // specified rule until the header is removed from the proxy binding
81 SaveResult[] sr = binding.create(new sObject[] { lead });
82 foreach (SaveResult s in sr)
83 {
84 if (s.success)
85 {
86 Console.WriteLine("Successfully created Lead with ID: {0}", s.id);
87 }
88 else
89 {
90 Console.WriteLine("Error creating Lead: {0}", s.errors[0].message);
91 }
92 }
93
94 // This call effectively removes the header. The next lead will be assigned
95 // to the default lead owner.
96 binding.AssignmentRuleHeaderValue = null;
97 }
98 }
99}
100