您位於此處:
InsProductService:getEligibleProducts
使用此服務尋找並傳回符合您所指定條件的產品清單。
方法:getEligibleProducts
運作方式
-
此服務會搜尋 Salesforce 以在指定的生效日期或更新日期中來取用一組啟用中產品。作為查詢的一部分,服務會使用在
filters、whereClause和productClasses選項中傳遞的條件來取得初始產品集。 -
如果找到的產品具有已設定的資格規則,則此服務會評估這些產品,並排除未評估為符合資格的產品。
-
如果屬性篩選條件設定於找到的剩餘產品上,則會套用屬性篩選條件,並排除已篩選掉的產品。
-
如果
returnProductObject設定為false,則傳回符合篩選條件的符合資格產品其產品識別碼清單。如果
returnProductObject設定為true,則傳回產品物件陣列。在這兩種情況下,如果將
includeFilterAttrValues設為true,則服務也會傳回filterAttrValues。
遠端選項
選項 |
描述 |
|---|---|
|
服務只會傳回滿足此篩選中所提供屬性值的產品。 |
|
預設為今天日期。 服務會提取在 |
|
使用 API 名稱加上冒號加上值或變數。例如,在 OmniScript 中,變數可以是元素的名稱,例如輸入選項清單。 使用逗號分隔多個篩選參數:
篩選條件可包含 |
|
預設為 在輸出 JSON 中,這會連同產品陣列一起新增 不包含子系產品屬性。 |
|
指定服務提取至 UI 的最後產品識別碼。 將此選項搭配 |
|
決定服務在一個通話中將多少產品退回到 UI。 |
|
“ProductClassName1,ProductClassName2” 產品類別名稱的逗號分隔清單。將產品清單限制為以下產品類別。 |
|
預設為 設定為 設定為 |
|
PartOfAProductName 如果使用此選項,則服務只會取得名稱包含您所提供值的產品。 |
|
productField1、productField2.. 依照您指定的順序排序服務取得的產品。 如果您未指定此選項的值,則服務會依名稱的遞增英文字母順序排序傳回的產品。 |
|
輸入任何有效的 Salesforce SOQL 陳述式作為此選項的值。 當您需要使用多重選項清單欄位作為篩選條件,或您需要使用任何其他複雜的篩選條件,而 |
輸出 JSON
服務會傳回產品識別碼清單。如果 includeFilterAttrValues 設定為 true,則服務也會傳回 filterAttrValues。
此範例包含 filterAttrValues。
{
"totalNumProducts": 6,
"effectiveDate": null,
"inputValues": {},
"filterAttrValues": {
"attri2": {
"listOfValues": [
{
"value": "test2",
"displayText": "test2"
}
],
"valueDataType": "Text",
"attributeLabel": "attri2",
"attributeName": "attri2",
"categoryName": "Test Attribute"
},
"AttntnDfctDsrdrs_Instrctn": {
"listOfValues": [
{
"value": "200",
"displayText": "200"
}
],
"valueDataType": "Percentage",
"attributeLabel": "Instruction",
"attributeName": "Instruction",
"categoryName": "ADD/ADHD"
},
"AbaThrpyOffProf_covered_oon": {
"listOfValues": [
{
"value": "100",
"displayText": "100"
}
],
"valueDataType": "Currency",
"attributeLabel": "Covered",
"attributeName": "Covered",
"categoryName": "ABA Therapy Office Professional"
},
"AddAdhd_select_oon": {
"listOfValues": [
{
"value": "9999999",
"displayText": "9999999"
}
],
"valueDataType": "Currency",
"attributeLabel": "Select",
"attributeName": "Select",
"categoryName": "ADD/ADHD"
},
"AlchlSbstnceAbseInptInst_Ded_oon": {
"listOfValues": [
{
"value": "null",
"displayText": "null"
}
],
"valueDataType": "Number",
"attributeLabel": "Deductible",
"attributeName": "Deductible",
"categoryName": "Alcohol/Substance Abuse - Inpatient Institutional"
},
"attri4": {
"listOfValues": [
{
"value": "56",
"displayText": "56"
}
],
"valueDataType": "Percentage",
"attributeLabel": "attri4",
"attributeName": "attri4",
"categoryName": "Test Attribute"
},
"attri1": {
"listOfValues": [
{
"value": "3000",
"displayText": "3000"
}
],
"valueDataType": "Currency",
"attributeLabel": "attri1",
"attributeName": "attri1",
"categoryName": "Test Attribute"
},
"AbaThrpyOutpProf_covered_oon": {
"listOfValues": [
{
"value": "null",
"displayText": "null"
}
],
"valueDataType": "Number",
"attributeLabel": "Covered",
"attributeName": "Covered",
"categoryName": "ABA Therapy Outpatient Professional"
},
"AcupOffProf_Ded_inn": {
"listOfValues": [
{
"value": "null",
"displayText": "null"
}
],
"valueDataType": "Number",
"attributeLabel": "Deductible",
"attributeName": "Deductible",
"categoryName": "Acupuncture Office Professional"
},
"COMPREHENSIVE": {
"listOfValues": [
{
"value": "2019",
"displayText": "2019"
}
],
"valueDataType": "Number",
"attributeLabel": "Comprehensive",
"attributeName": "Comprehensive",
"categoryName": "Auto Coverage"
},
"amountDeductible": {
"listOfValues": [
{
"value": "1000",
"displayText": "1000"
}
],
"valueDataType": "Currency",
"attributeLabel": "Property Deductible",
"attributeName": "Property Deductible",
"categoryName": "Coverages and Limits of Liability"
}
},
"products": [
"01t1U000000kZhdQAE",
"01t1U000003NOvbQAG",
"01t1U000002Jg6RQAS",
"01t1U000003NIDIQA4",
"01t1U000003NIDNQA4",
"01t1U000000kZiAQAU"
],
"error": "OK"
}
當 returnProductObject 設定為 true 時,服務會傳回產品清單。
此範例也包含 filterAttrValues。
{
"totalNumProducts": 6,
"effectiveDate": null,
"inputValues": {},
"filterAttrValues": {
"attri2": {
"listOfValues": [
{
"value": "test2",
"displayText": "test2"
}
],
"valueDataType": "Text",
"attributeLabel": "attri2",
"attributeName": "attri2",
"categoryName": "Test Attribute"
},
"AttntnDfctDsrdrs_Instrctn": {
"listOfValues": [
{
"value": "200",
"displayText": "200"
}
],
"valueDataType": "Percentage",
"attributeLabel": "Instruction",
"attributeName": "Instruction",
"categoryName": "ADD/ADHD"
},
"AbaThrpyOffProf_covered_oon": {
"listOfValues": [
{
"value": "100",
"displayText": "100"
}
],
"valueDataType": "Currency",
"attributeLabel": "Covered",
"attributeName": "Covered",
"categoryName": "ABA Therapy Office Professional"
},
"AddAdhd_select_oon": {
"listOfValues": [
{
"value": "9999999",
"displayText": "9999999"
}
],
"valueDataType": "Currency",
"attributeLabel": "Select",
"attributeName": "Select",
"categoryName": "ADD/ADHD"
},
"AlchlSbstnceAbseInptInst_Ded_oon": {
"listOfValues": [
{
"value": "null",
"displayText": "null"
}
],
"valueDataType": "Number",
"attributeLabel": "Deductible",
"attributeName": "Deductible",
"categoryName": "Alcohol/Substance Abuse - Inpatient Institutional"
},
"attri4": {
"listOfValues": [
{
"value": "56",
"displayText": "56"
}
],
"valueDataType": "Percentage",
"attributeLabel": "attri4",
"attributeName": "attri4",
"categoryName": "Test Attribute"
},
"attri1": {
"listOfValues": [
{
"value": "3000",
"displayText": "3000"
}
],
"valueDataType": "Currency",
"attributeLabel": "attri1",
"attributeName": "attri1",
"categoryName": "Test Attribute"
},
"AbaThrpyOutpProf_covered_oon": {
"listOfValues": [
{
"value": "null",
"displayText": "null"
}
],
"valueDataType": "Number",
"attributeLabel": "Covered",
"attributeName": "Covered",
"categoryName": "ABA Therapy Outpatient Professional"
},
"AcupOffProf_Ded_inn": {
"listOfValues": [
{
"value": "null",
"displayText": "null"
}
],
"valueDataType": "Number",
"attributeLabel": "Deductible",
"attributeName": "Deductible",
"categoryName": "Acupuncture Office Professional"
},
"COMPREHENSIVE": {
"listOfValues": [
{
"value": "2019",
"displayText": "2019"
}
],
"valueDataType": "Number",
"attributeLabel": "Comprehensive",
"attributeName": "Comprehensive",
"categoryName": "Auto Coverage"
},
"amountDeductible": {
"listOfValues": [
{
"value": "1000",
"displayText": "1000"
}
],
"valueDataType": "Currency",
"attributeLabel": "Property Deductible",
"attributeName": "Property Deductible",
"categoryName": "Coverages and Limits of Liability"
}
},
"products": [
{
"attributes": {
"type": "Product2",
"url": "/services/data/v47.0/sobjects/Product2/01t1U000000kZhdQAE"
},
"ProductCode": "Rent-ECO",
"Family": "Personal Lines",
"instest04__LineOfBusiness__c": "Property & Casualty",
"Id": "01t1U000000kZhdQAE",
"instest04__AttributeDefaultValues__c": "{\"amountDeductible\":1000}",
"RecordTypeId": "0121U000000iuvEQAQ"
},
{
"attributes": {
"type": "Product2",
"url": "/services/data/v47.0/sobjects/Product2/01t1U000003NOvbQAG"
},
"ProductCode": "Rent-ECOCLONEDCLONED",
"Family": "Personal Lines",
"instest04__LineOfBusiness__c": "Property & Casualty",
"Id": "01t1U000003NOvbQAG",
"instest04__AttributeDefaultValues__c": "{\"COMPREHENSIVE\":2019,\"AlchlSbstnceAbseInptInst_Ded_oon\":\"\",\"AttntnDfctDsrdrs_Instrctn\":\"200\",\"AddAdhd_select_oon\":9999999,\"AbaThrpyOffProf_covered_oon\":100,\"AbaThrpyOutpProf_covered_oon\":\"\",\"AcupOffProf_Ded_inn\":\"\",\"attri2\":\"test2\",\"attri4\":\"56\",\"attri1\":3000}",
"RecordTypeId": "0121U000000iuvEQAQ"
},
{
"attributes": {
"type": "Product2",
"url": "/services/data/v47.0/sobjects/Product2/01t1U000002Jg6RQAS"
},
"ProductCode": "Rent-ECOCLONED",
"Family": "Personal Lines",
"instest04__LineOfBusiness__c": "Property & Casualty",
"Id": "01t1U000002Jg6RQAS",
"instest04__AttributeDefaultValues__c": "{\"COMPREHENSIVE\":2019,\"AlchlSbstnceAbseInptInst_Ded_oon\":\"\",\"AttntnDfctDsrdrs_Instrctn\":\"200\",\"AddAdhd_select_oon\":9999999,\"AbaThrpyOffProf_covered_oon\":100,\"AbaThrpyOutpProf_covered_oon\":\"\",\"AcupOffProf_Ded_inn\":\"\",\"attri2\":\"test2\",\"attri4\":\"56\",\"attri1\":3000}",
"RecordTypeId": "0121U000000iuvEQAQ"
},
{
"attributes": {
"type": "Product2",
"url": "/services/data/v47.0/sobjects/Product2/01t1U000003NIDIQA4"
},
"ProductCode": "Rent-ECOCLONEDCLONEDCLONED",
"Family": "Personal Lines",
"instest04__LineOfBusiness__c": "Property & Casualty",
"Id": "01t1U000003NIDIQA4",
"instest04__AttributeDefaultValues__c": "{\"COMPREHENSIVE\":2019,\"AlchlSbstnceAbseInptInst_Ded_oon\":\"\",\"AttntnDfctDsrdrs_Instrctn\":\"200\",\"AddAdhd_select_oon\":9999999,\"AbaThrpyOffProf_covered_oon\":100,\"AbaThrpyOutpProf_covered_oon\":\"\",\"AcupOffProf_Ded_inn\":\"\",\"attri2\":\"test2\",\"attri4\":\"56\",\"attri1\":3000}",
"RecordTypeId": "0121U000000iuvEQAQ"
},
{
"attributes": {
"type": "Product2",
"url": "/services/data/v47.0/sobjects/Product2/01t1U000003NIDNQA4"
},
"ProductCode": "Rent-ECOCLONEDCLONEDCLONEDCLONED",
"Family": "Personal Lines",
"instest04__LineOfBusiness__c": "Property & Casualty",
"Id": "01t1U000003NIDNQA4",
"instest04__AttributeDefaultValues__c": "{\"COMPREHENSIVE\":2019,\"AlchlSbstnceAbseInptInst_Ded_oon\":\"\",\"AttntnDfctDsrdrs_Instrctn\":\"200\",\"AddAdhd_select_oon\":9999999,\"AbaThrpyOffProf_covered_oon\":100,\"AbaThrpyOutpProf_covered_oon\":\"\",\"AcupOffProf_Ded_inn\":\"\",\"attri2\":\"test2\",\"attri4\":\"56\",\"attri1\":3000}",
"RecordTypeId": "0121U000000iuvEQAQ"
},
{
"attributes": {
"type": "Product2",
"url": "/services/data/v47.0/sobjects/Product2/01t1U000000kZiAQAU"
},
"ProductCode": "Rent-SUPER",
"Family": "Personal Lines",
"instest04__LineOfBusiness__c": "Property & Casualty",
"Id": "01t1U000000kZiAQAU",
"instest04__AttributeDefaultValues__c": "{\"AbaThrpyOffProf_Instrctn\":null}",
"RecordTypeId": "0121U000000iuvEQAQ"
}
],
"error": "OK"
}