Newer Version Available
AffinityScoreDefinition
Parent Type
File Suffix and Directory Location
AffinityScoreDefinition components have the suffix .affinityScoreDefinition and are stored in the affinityScoreDefinitions folder.
Version
AffinityScoreDefinition components are available in API version 65.0 and later.
Special Access Rules
This metadata type is available only if the Fundraising Access license is enabled for the org and the Fundraising admin permission is assigned to users.
Fields
| Field Name | Description |
|---|---|
| affinityScoreDefinitionDesc |
|
| affinityScoreDefinitionName |
|
| affinityScoreType |
|
| masterLabel |
|
| numberOfMonths |
|
| numberOfRanges |
|
| scoreRangeList |
|
| sourceFieldApiNameList |
|
| sourceObjectApiNameList |
|
| targetFieldApiNameList |
|
| targetObjectApiName |
|
Declarative Metadata Sample Definition
This example shows a sample of an AffinityScoreDefinition component.
1<?xml version="1.0" encoding="UTF-8"?>
2<AffinityScoreDefinition
3 xmlns="http://soap.sforce.com/2006/04/metadata">
4 <affinityScoreDefinitionDesc>RFM Affinity Score</affinityScoreDefinitionDesc>
5 <affinityScoreDefinitionName>AffinityScoreDefinition_RFM</affinityScoreDefinitionName>
6 <affinityScoreType>RFM</affinityScoreType>
7 <masterLabel>MasterLabel</masterLabel>
8 <numberOfMonths>12</numberOfMonths>
9 <numberOfRanges>3</numberOfRanges>
10 <scoreRangeList>
11 [
12 {
13 "name": "R Ranges",
14 "direction": "ascending",
15 "ranges": [30,90,180]
16 },
17 {
18 "name": "F Ranges",
19 "direction": "descending",
20 "ranges": [10,15,100]
21 },
22 {
23 "name": "M Ranges",
24 "direction": "descending",
25 "ranges": [500,1000,5000]
26 }
27 ]
28 </scoreRangeList>
29 <sourceFieldApiNameList>
30 [
31 {
32 "name": "R Source",
33 "values":
34 [
35 {
36 "fieldName": "DonorGiftSummary.DaysSinceLastGift",
37 "fieldWeight": 1
38 }
39 ]
40 },
41 {
42 "name": "F Source",
43 "values":
44 [
45 {
46 "fieldName": "DonorGiftSummary.GiftCount",
47 "fieldWeight": 1
48 }
49 ]
50 },
51 {
52 "name": "M Source",
53 "values":
54 [
55 {
56 "fieldName": "DonorGiftSummary.TotalGiftsCount",
57 "fieldWeight": 1
58 }
59 ]
60 }
61 ]
62 </sourceFieldApiNameList>
63 <targetFieldApiNameList>
64 [
65 {
66 "name": "R Target",
67 "values":
68 [
69 {
70 "fieldName": "DonorGiftSummary.RecencyScore",
71 "fieldWeight": 1
72 }
73 ]
74 },
75 {
76 "name": "F Target",
77 "values":
78 [
79 {
80 "fieldName": "DonorGiftSummary.FrequencyScore",
81 "fieldWeight": 1
82 }
83 ]
84 },
85 {
86 "name": "M Target",
87 "values":
88 [
89 {
90 "fieldName": "DonorGiftSummary.MonetaryScore",
91 "fieldWeight": 1
92 }
93 ]
94 }
95 ]
96 </targetFieldApiNameList>
97</AffinityScoreDefinition>This example shows a sample of the package.xml file that references the previous definition.
1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3 <types>
4 <members>*</members>
5 <name>AffinityScoreDefinition</name>
6 </types>
7 <version>65.0</version>
8</Package>Wildcard Support in the Manifest File
This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.