Loading
Assicurazioni
InsProductService:getEligibleProducts

InsProductService:getEligibleProducts

Utilizzare questo servizio per trovare e restituire un elenco di prodotti che soddisfano i criteri specificati.

Classe: InsProductService

Metodo: getEligibleProducts

Funzionamento

  1. Il servizio esegue una ricerca in Salesforce per recuperare una serie di prodotti attivi che cadono alla data effettiva specificata o successiva. Nell'ambito della query, il servizio utilizza i criteri passati nell'opzione filters, whereClause e productClasses per ottenere un insieme iniziale di prodotti.

  2. Se per i prodotti trovati sono impostate regole di idoneità, questo servizio li valuta ed elimina quelli che non sono considerati idonei.

  3. Applica i filtri degli attributi se sono impostati sui prodotti rimanenti trovati ed elimina quelli esclusi.

  4. Se returnProductObject è impostato su false, restituisce un elenco di ID prodotto dei prodotti idonei che soddisfano i criteri di filtro.

    Se returnProductObject è impostato su true, restituisce una matrice di oggetti prodotto.

    In entrambi i casi, se includeFilterAttrValues è impostato su true, il servizio restituisce anche filterAttrValues.

Opzioni remote

Opzione

Descrizione

attributeFilters

Una mappa di attributeCode e valori

I servizi restituiscono solo i prodotti che soddisfano i valori degli attributi forniti in questo filtro.

effectiveDate

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

Per impostazione predefinita, la data odierna.

Service estrae i prodotti con un'effectiveDate tra EffectiveDate__c e EndDate__c e IsActive.

filters

Product2FieldName:Value

Product2FieldName:%ElementName%

Utilizzare il nome API con i due punti seguiti da un valore o da una variabile. Ad esempio, in un OmniScript, una variabile può essere il nome di un elemento, ad esempio un elenco di selezione di input.

Separare più parametri di filtro con virgole:

ProductCode:Value,ProductCode:%ElementName%

I filtri possono includere qualsiasi campo dell'oggetto Product2.

includeFilterAttrValues

true o false

Per impostazione predefinita, false.

Nel JSON di output, insieme alla matrice di prodotti, viene aggiunto l'oggetto filterAttrValues. Questo oggetto contiene gli attributi del prodotto radice contrassegnati come filtrabili, con il possibile elenco di valori. Questo elenco è utilizzato da alcuni modelli di interfaccia utente per filtrare insiemi di prodotti di grandi dimensioni.

Gli attributi dei prodotti secondari non sono inclusi.

lastRecordId

Specifica l'ultimo ID prodotto inserito dal servizio nell'interfaccia utente.

Utilizzare questa opzione con l'opzione pageSize.

pageSize

Determinare quanti prodotti il servizio restituisce all'interfaccia utente in una sola chiamata.

productClasses

“ProductClassName1,ProductClassName2”

Elenco separato da virgole dei nomi delle classi di prodotto. Limita l'elenco dei prodotti a queste classi di prodotti.

returnProductObject

true o false

L'impostazione predefinita è

Se impostato su true, il servizio restituisce una matrice di oggetti prodotto. Questa risposta include un elenco di oggetti prodotto, con i campi specificati nel set di campi EligibleProductFields.

Se impostato su false, il servizio restituisce un elenco di ID prodotto.

searchText

PartOfAProductName

Se si utilizza questa opzione, il servizio ottiene solo i prodotti con nomi che contengono il valore specificato.

sortBy

productField1, productField2..

Ordina i prodotti ottenuti dal servizio nell'ordine specificato.

Se non si specifica un valore per questa opzione, il servizio ordina i prodotti restituiti per nome in ordine alfabetico crescente.

whereClause

Immettere qualsiasi istruzione SOQL Salesforce valida come valore per questa opzione.

Utilizzare questa opzione quando è necessario utilizzare il campo elenco a selezione multipla come filtro o utilizzare qualsiasi altra condizione di filtro complessa che l'opzione filters non è in grado di gestire.

Input JSON

Questo servizio può userInputs come input.

JSON di output

Il servizio restituisce un elenco di ID prodotto. Se includeFilterAttrValues è impostato su true, il servizio restituisce anche filterAttrValues.

Questo esempio include 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"
}

Quando returnProductObject è impostato su true, il servizio restituisce un elenco di prodotti.

Questo esempio include anche 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"
}
 
Caricamento
Salesforce Help | Article