Loading
保險
InsProductService:getEligibleProducts

InsProductService:getEligibleProducts

使用此服務尋找並傳回符合您所指定條件的產品清單。

類別:InsProductService

方法:getEligibleProducts

運作方式

  1. 此服務會搜尋 Salesforce 以在指定的生效日期或更新日期中來取用一組啟用中產品。作為查詢的一部分,服務會使用在 filters、whereClause 和 productClasses 選項中傳遞的條件來取得初始產品集。

  2. 如果找到的產品具有已設定的資格規則,則此服務會評估這些產品,並排除未評估為符合資格的產品。

  3. 如果屬性篩選條件設定於找到的剩餘產品上,則會套用屬性篩選條件,並排除已篩選掉的產品。

  4. 如果 returnProductObject 設定為 false,則傳回符合篩選條件的符合資格產品其產品識別碼清單。

    如果 returnProductObject 設定為 true,則傳回產品物件陣列。

    在這兩種情況下,如果將 includeFilterAttrValues 設為 true,則服務也會傳回 filterAttrValues。

遠端選項

選項

描述

attributeFilters

attributeCode 與值的對應

服務只會傳回滿足此篩選中所提供屬性值的產品。

effectiveDate

“YYYY-MM-DD HH:MM:SS” 或 %OmniScriptDataElement%

預設為今天日期。

服務會提取在 EffectiveDate__c 和 EndDate__c 和 IsActive 之間有 effectiveDate 的產品。

filters

Product2FieldName:Value

Product2FieldName:%ElementName%

使用 API 名稱加上冒號加上值或變數。例如,在 OmniScript 中,變數可以是元素的名稱,例如輸入選項清單。

使用逗號分隔多個篩選參數:

ProductCode:Value,ProductCode:%ElementName%

篩選條件可包含 Product2 物件上的任何欄位。

includeFilterAttrValues

true 或 false

預設為 false。

在輸出 JSON 中,這會連同產品陣列一起新增 filterAttrValues 物件。此物件包含標記為可篩選的根產品屬性,以及可能的值清單。某些 UI 範本會使用此清單來篩選大型產品集。

不包含子系產品屬性。

lastRecordId

指定服務提取至 UI 的最後產品識別碼。

將此選項搭配 pageSize 選項使用。

pageSize

決定服務在一個通話中將多少產品退回到 UI。

productClasses

“ProductClassName1,ProductClassName2”

產品類別名稱的逗號分隔清單。將產品清單限制為以下產品類別。

returnProductObject

true 或 false

預設為

設定為 true 時,服務會傳回產品物件陣列。此回應包含產品物件清單,其中包含在 EligibleProductFields 欄位集中指定的欄位。

設定為 false 時,服務會傳回產品識別碼清單。

searchText

PartOfAProductName

如果使用此選項,則服務只會取得名稱包含您所提供值的產品。

sortBy

productField1、productField2..

依照您指定的順序排序服務取得的產品。

如果您未指定此選項的值,則服務會依名稱的遞增英文字母順序排序傳回的產品。

whereClause

輸入任何有效的 Salesforce SOQL 陳述式作為此選項的值。

當您需要使用多重選項清單欄位作為篩選條件,或您需要使用任何其他複雜的篩選條件,而 filters 選項無法處理時,請使用此選項。

輸入 JSON

此服務可作為輸入 userInputs。

輸出 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"
}
 
正在載入
Salesforce Help | Article