Loading
保险
InsProductService:getEligibleProducts

InsProductService:getEligibleProducts

使用此服务查找并返回符合您指定条件的产品列表。

类:InsProductService

方法:getEligibleProducts

工作原理

  1. 该服务会搜索 Salesforce,以检索在指定生效日期或之后的有效产品集。作为查询的一部分,服务使用在filters、whereClause和productClasses选项中传递的标准来获取一组初始产品。

  2. 如果找到的产品设置了资格规则,此服务会对其进行评估,并剔除那些未评估为合格的产品。

  3. 如果属性筛选器设置在找到的剩余产品上,则应用属性筛选器,并消除筛选出的产品。

  4. 如果returnProductObject设置为false,则返回符合筛选条件的合格产品的产品 ID 列表。

    如果 returnProductObject 设置为 true,则返回产品对象的数组。

    在这两种情况下,如果 includeFilterAttrValues 设置为 true,服务也会返回 filterAttrValues。

远程选项

选项

说明

attributeFilters

attributeCode和值的映射

服务仅返回满足此筛选器中提供的属性值的产品。

effectiveDate

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

默认为今天的日期。

服务拉取effectiveDate于EffectiveDate__c、EndDate__c和IsActive之间的产品。

filters

Product2FieldName:Value

Product2FieldName:%ElementName%

使用带有冒号的 API 名称,后跟值或变量。例如,在 OmniScript 中,变量可以是元素的名称,例如输入选项列表。

使用逗号分隔多个筛选器参数:

ProductCode:Value,ProductCode:%ElementName%

筛选器可以包括Product2对象上的任何字段。

includeFilterAttrValues

true 或 false

默认为 false。

在输出 JSON 中,与产品阵列一起,添加filterAttrValues对象。此对象包含标记为可筛选的根产品属性,以及可能的值列表。一些 UI 模板使用此列表来筛选大型产品集。

不包括子产品属性。

lastRecordId

指定服务提取到 UI 中的最后一个产品 ID。

将此选项与pageSize选项一起使用。

pageSize

确定服务在一次调用中返回到 UI 的产品数量。

productClasses

“ProductClassName1,ProductClassName2”

产品类名称的逗号分隔列表。将产品列表限制为这些产品类。

returnProductObject

true 或 false

默认设置为

在设置为 true 时,服务会返回一系列产品对象。此响应包含产品对象列表,并在EligibleProductFields字段集中指定字段。

在设置为 false 时,服务会返回产品 ID 列表。

searchText

PartOfAProductName

如果使用此选项,服务仅会获取名称包含您提供值的产品。

sortBy

productField1、productField2..

按照您指定的顺序对服务获得的产品进行排序。

如果不为此选项指定值,服务会按名称升序排序返回的产品。

whereClause

输入任何有效的 salesforce SOQL 语句作为此选项的值。

当您需要使用多选项列表字段作为筛选器,或者您需要使用filters选项无法处理的任何其他复杂筛选条件时,请使用此选项。

输入 JSON

此服务可以作为输入userInputs。

输出 JSON

该服务返回产品 ID 列表。如果 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