Options
All
  • Public
  • Public/Protected
  • All
Menu

Product Console Facade to interact with Vlocity Product Console functionality.

version

v104

Hierarchy

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

Properties

Private config

Configuration for this SDK.

Static Private instance

instance: ProductConsole

Singleton instance of this SDK.

Accessors

namespace

  • get namespace(): string
  • set namespace(customNamespace: string): void
  • getter method for namespace. Provides the salesforce org namespace

    Returns string

  • setter method for namespace. Set custom namespace

    Parameters

    • customNamespace: string

    Returns void

Methods

addContextRuleSetToPriceListEntry

  • Adds a context rule set on a price list entry.

    Parameters

    Returns Promise<Result>

    • Promise that returns a success or failure message.

createAppliedPriceListEntriesInput

  • Create a default GetAppliedPriceListEntriesInput object.

    Returns GetAppliedPriceListEntriesInput

    • a GetAppliedPriceListEntriesInput instance.

createAppliedPromotionsInput

  • Create a default GetAppliedPromotionsInput object.

    Returns GetAppliedPromotionsInput

    • a GetAppliedPromotionsInput instance.

createAttributeAssignments

  • Parameters

    Returns Promise<any>

createAttributeOverride

  • This function will execute remote call to create override for an attribute

    Parameters

    Returns Promise<any>

createChildProduct

  • This function will create a new child product as provided in the CreateChildProductInput.

    Parameters

    Returns Promise<Result>

    result in a promise of the child product creation. Result will contain the newly created relationship ID.

createContextRuleSetInput

  • Creates and returns an instance of input class for GetPriceListEntryInput

    Parameters

    Returns AddContextRuleSetInput

createCreateChildProductInput

  • Creates and returns an instance of input class for CreateChildProductInput

    Returns CreateChildProductInput

createCreateOverrideInput

  • Creates and returns an instance of input class for CreateOverrideInput

    Returns CreateOverrideInput

createCreateProductInput

  • Creates and returns an instance of input class for CreateProductInput

    Returns CreateProductInput

createCreateVlocityAttachmentsInput

  • Creates and returns input object for creating VlocityAttachment objects.

    Returns CreateVlocityAttachmentsInput

    • Returns the default input object for calling createVlocityAttachments sdk function.

createDeleteContextRuleInput

  • Creates and returns an instance of input class for DeletePriceListEntryInput

    Parameters

    • contextRuleId: string

    Returns DeleteContextRuleInput

createDeleteOverrideInput

  • Creates and returns an instance of input class for DeleteOverrideInput

    Returns DeleteOverrideInput

createDeletePriceListEntryInput

  • Creates and returns an instance of input class for DeletePriceListEntryInput

    Parameters

    • priceListEntryId: string

    Returns DeletePriceListEntryInput

createDeleteSalesForceDocumentInput

  • Creates and returns an instance of input class for DeleteSalesForceDocumentInput(

    Parameters

    • documentId: any

    Returns DeleteSalesForceDocumentInput

createDeleteVlocityAttachmentInput

  • Creates and returns an instance of input class for DeleteVlocityAttachmentInput

    Parameters

    • attachmentId: any

    Returns DeleteVlocityAttachmentInput

createEditPriceListEntryInput

createEditPromotionOfferPriceListEntryInput

createGetAppliedFieldsAndAttributesInput

createGetObjectDescriptionInput

createGetObjectPicklistsInput

  • Returns an instance of GetObjectPicklistisInput class

    Returns GetObjectPicklistsInput

createGetOverrideInput

  • Creates and returns an instance of input class for GetOverrideInput

    Returns GetOverrideInput

createGetProduct2ObjectInput

  • Creates and returns Input object for getting Product2 object details

    Returns GetProduct2ObjectInput

    • Returns the default input object for getProduct2Object sdk function.

createGetProductAttributeAssignmentsInput

createGetProductDataInput

createGetProductDefinitionInput

  • This function creates and returns a default input object that can be used to call the getProductDefinition sdk function.

    Returns GetProductDefinitionInput

    • Creates and returns an instance of input class for getProductDefinition.

createGetProductDetailsInput

  • Create a default GetProductDetails object.

    Returns GetProductDetailsInput

    • a GetProductDetailsInput instance.

createGetProductHierarchyPath

  • Creates and returns an instance of input class for GetHierarchyPathInput

    Returns GetHierarchyPathInput

createGetProductTemplatesInput

  • Creates and returns Input object for getting product templates

    Returns GetProductTemplatesInput

createGetProductsInput

  • Creates and returns Input object for getting products

    Returns GetProductsInput

    • Returns the default input object for getProducts sdk function.

createGetTimePlanPolicyInput

createGetVlocityAttachmentDetailsInput

  • Creates and returns an instance of input class for GetVlocityAttachmentDetailsInput

    Returns GetVlocityAttachmentDetailsInput

createGetVlocityAttachmentsInput

  • Creates and returns Input object for getting vlocity attachments

    Returns GetVlocityAttachmentsInput

    • Returns the default input object for getVlocityAttachments sdk function.

createNewAttributeAssignmentsInput

  • Creates input object for createAttributeAssignments sdk function.

    Returns NewAttributeAssignmentsInput

createOffersInput

  • Creates and returns an instance of input class for GetOffersInput

    Parameters

    • params: object

    Returns GetOffersInput

createParentChildItemInput

  • Creates and returns an instance of input class for ParentChildItemInput

    Returns ParentChildItemInput

createPreValidatePCIOverrideObject

  • Creates and returns an instance of input class for PreValidatePCIOverrideObjectInput

    Returns PreValidatePCIOverrideObjectInput

createPriceListEntry

  • Creates a price list entry for price, cost, promotion, and offer tables. Aside from the standard price list entry, this method supports overrides and adjustments.

    Parameters

    Returns Promise<Result>

    • Promise that returns the id of the new price list entry.

createPriceListEntryInput

createPriceListInput

  • Creates and returns an instance of input class for GetPriceListInput

    Returns GetPriceListInput

createPricingElementInput

  • Creates and returns an instance of input class for GetPricingElementInput

    Parameters

    • params: object

    Returns GetPricingElementInput

createPricingPickListInput

  • Creates and returns an instance of input class for GetPricingPickListInput

    Returns GetPricingPickListInput

createPricingVariableInput

  • Creates and returns an instance of input class for GetPricingVariableInput

    Parameters

    • params: object

    Returns GetPricingVariableInput

createProduct

  • This function will create a new product as provided in the CreateProductInput.

    Parameters

    Returns Promise<Result>

    result in a promise of the product creation. Result will contain the newly created product with ID.

createPromotion

  • Creates a promotion.

    Parameters

    Returns Promise<Result>

    • Promise that returns a success or failure message.

createPromotionInput

  • Creates and returns an instance of input class for CreatePromotionInput

    Parameters

    Returns CreatePromotionInput

createPromotionItem

  • Creates a promotion item.

    Parameters

    Returns Promise<Result>

    • Promise that returns a success or failure message.

createPromotionItemInput

createPromotionOfferPriceListEntryInput

createPublishProductInput

  • Creates the input object for publishProduct remote action.

    Returns PublishProductInput

createQuickAddPricingPropertiesInput

  • Creates an input for getting the quick adds pricing properties.

    Returns GetQuickAddPricingPropertiesInput

    • input to define quick add pricing properties.

createQuickAddProductPropertiesInput

  • This function returns the default input object which can be used for calling getQuickAddProductProperties sdk function.

    Returns GetQuickAddProductPropertiesInput

createSaveAttributeAssignmentInput

createSaveOverrideInput

  • Creates and returns an instance of input class for SaveOverrideInput

    Returns SaveOverrideInput

createSearchRelatedObjectsInput

  • Returns the input instance getSearchResults sdk function.

    Returns SearchRelatedObjectsInput

createSimpleProductsSearchInput

  • Creates the input object for searchProductByText remote action.

    Returns SimpleProductSearchInput

createTimePlanPolicyIdsInput

  • Creates and returns an instance of input class for GetTimePlanPolicyIdsInput

    Parameters

    • params: object

    Returns GetTimePlanPolicyIdsInput

createUpdateAttributeAssignmentsInput

  • Returns the instance of the input class when updating all attributes for an object

    Returns UpdateAttributeAssignmentsInput

createUpdateObjectInput

  • Returns the instance of the input class when updating all fields for an object

    Returns UpdateObjectInput

createUpdateProductAttributeInput

  • Returns the default input object for calling updateProductAttribute

    Returns UpdateProductAttributeInput

createUpdateProductDefintionInput

  • Creates and returns a default instance of input object for calling updateProductDefinition sdk function.

    Returns UpdateProductDefinitionInput

    • Input object for calling updateProductDefinition sdk function.

createUpdateProductFieldInput

  • Creates and returns input object for updating a single field. Input object contains a key value pair for field name and field value.

    Returns UpdateProductFieldInput

    • Input object for calling updateProductField sdk function.

createUpdateProductInput

  • Creates and returns an instance of input class for UpdateProductInput

    Returns UpdateProductInput

createUpdateSingleAttributeInput

createVlocityAttachments

  • Creates multiple VlocityAttachment records. Used for linking documents with product.

    API Path: (POST) /services/data/v43.0/composite/sobjects

    Parameters

    Returns Promise<BulkCreateResult[]>

    • Promise that resolves to a list of records with Ids of the VlocityAttachment records that were created.

deleteAttributeOverride

  • This function will execute remote call to create override for an attribute

    Parameters

    Returns Promise<any>

deleteContextRule

  • Deletes a context rule.

    Parameters

    Returns Promise<Result>

    • Promise that returns a success or failure message.

deleteParentChildItem

  • This will delete an existing ParentChildItem record as provided in ParentChildItemInput.

    API Path: (DELETE) /services/data/v43.0/sobjects/{namespacePrefix}ProductChildItem__c/{input.parentChildItemId}

    Parameters

    Returns Promise<any>

deletePriceListEntry

  • Deletes a price list entry.

    Parameters

    Returns Promise<Result>

    • Promise that returns a success or failure message.

deleteSalesForceDocument

  • Salesforce document delete

    Parameters

    Returns Promise<Result>

    • Promise that returns a success or failure message.

deleteVlocityAttachment

  • Vlocity Attachment delete

    Parameters

    Returns Promise<Result>

    • Promise that returns a success or failure message.

editPriceListEntry

  • Edits a price list entry for price, cost, promotion, and offer tables. Aside from the standard price list entry, this method supports overrides and adjustments.

    Parameters

    Returns Promise<Result>

    • Promise that returns the id of the new price list entry.

getAppliedCostPricelistEntries

  • This function will return a list of pricelists that are applicable for this product.

    Parameters

    Returns Promise<Result>

    • a promise with the pricelists associtated with the product id.

getAppliedFieldsAndAttributes

  • Get fields and attributes mapped to the object id. Currently uses remote datasource. So this needs VF Page to work.

    todo
    • Use Dual datasource when the apexrest endpoint is available.

    Parameters

    Returns Promise<any>

getAppliedPricelistEntries

  • This function will return a list of pricelists that are applicable for this product.

    Parameters

    Returns Promise<Result>

    • a promise with the pricelists associtated with the product id.

getAppliedPromotions

  • This function will return a list of promotions that are applicable for this product.

    Parameters

    Returns Promise<Result>

    • a promise with the promotions associtated with the product id.

getAttributeOverride

  • This function will execute remote call to get override for an attribute

    Parameters

    Returns Promise<any>

getFolderByName

  • getFolderByName(folderName: any): Promise<Result>
  • Returns the folderId for a given folder name. FolderId is required when creating documents.

     API Path: (GET) /services/data/v43.0/query 

    Parameters

    • folderName: any

    Returns Promise<Result>

    • Promise that resolves to a list of records that match the folder name. Each record has Id and Name of the folder.

getObjectDescription

getObjectPicklistsByName

getOffers

  • Gets a productId and all of the offers for it.

    Parameters

    • input: GetOffersInput

      The offers input with the remoteClass, remoteMethod, parameters and paramsArray function.

    Returns Promise<Result>

    • Promise that returns the list of offers.

getPriceList

  • This function returns a list of price list.

    Parameters

    Returns Promise<Result>

    • Promise that returns the price list.

getPricingElement

  • Gets a pricing element and returns it's id.

    Parameters

    • input: GetPricingElementInput

      The pricing element input with the remoteClass, remoteMethod, parameters and paramsArray function.

    Returns Promise<Result>

    • Promise that returns the pricing element id.

getPricingPicklistItems

  • Gets the list of picklist items for the pricing tab.

    Parameters

    • input: GetPricingPickListInput

      The picklist item input with the remoteClass, remoteMethod, and paramsArray function.

    Returns Promise<Result>

    • Promise that returns the picklist item labels for the pricing tab.

getPricingVariable

  • Gets the list of pricing variables.

    Parameters

    • input: GetPricingVariableInput

      The pricing variable input with the remoteClass, remoteMethod, parameters and paramsArray function.

    Returns Promise<Result>

    • Promise that returns the pricing variable(s).

getProduct2Object

  • Returns Id for Product2 object

    Parameters

    Returns Promise<Result>

    • Promise that resolves to the Id of Product2 object.

getProductAttributeAssignments

getProductChildItem

  • This function returns a list of attributes, fields and attribute values that are available for the corresponding ProductChildItem Id.

    API Path: (GET) /services/data/v43.0/sobjects/{namespacePrefix}ProductChildItem__c/{input.parentChildItemId}

    Parameters

    Returns Promise<any>

    • A promise that resolves to the list of available fields, attributes and attribute values.

getProductData

  • Parameters

    Returns Promise<any>

getProductDefinition

  • Gets the product definition for a given product. Definition contains a list of sections and section elements within each section.

    API Path: (GET) /v1/studio/object/{input.productId}/facets/{input.facetName}

    Parameters

    Returns Promise<Result>

    • prommise that resolves to the product definition which is a list of sections. Each section has a sectionElements.records which represent the fields and attributes.

getProductDetails

  • Function which returns a product and its children

    Parameters

    Returns Promise<Result>

getProductHierarchyPath

  • This function will execute remote call to get hierarchy path for a product

    Parameters

    Returns Promise<any>

getProductTemplates

  • Returns a list of product template records for a given productId.

    Parameters

    Returns Promise<Result>

getProducts

  • Returns a list of products.

    Parameters

    Returns Promise<Result>

    • Promise that resolves to a list of products of Product2 object. Each record has Name, Id and Description of the product.

getQuickAddPricingElements

  • This function returns a list of attributes, fields and attribute values that are available for assignment to a given product.

    Parameters

    Returns Promise<Result>

getQuickAddPricingExistingPromotions

  • This function returns a list of attributes, fields and attribute values that are available for assignment to a given product.

    Parameters

    Returns Promise<Result>

getQuickAddPricingRules

  • This function returns a list of attributes, fields and attribute values that are available for assignment to a given product.

    Parameters

    Returns Promise<Result>

getQuickAddProductProperties

  • This function returns a list of attributes, fields and attribute values that are available for assignment to a given product.

    API Path: /v1/studio/object/{input.productid}/facet/{input.facet}/available.

    Parameters

    Returns Promise<Result>

    • A promise that resolves to the list of available fields, attributes and attribute values which can be applied to the product.

getRecentlyViewedProducts

  • getRecentlyViewedProducts(): Promise<any>
  • Returns the list of most recently viewed products ordered descending by Last viewed date.

    Returns Promise<any>

getSalesForceDocumentDetails

  • getSalesForceDocumentDetails(documentId: string): Promise<Result>
  • Salesforce document details

    Parameters

    • documentId: string

      The documentId to fetch details.

    Returns Promise<Result>

    • Promise that returns a success or failure message.

getTimePlan

  • Gets Time Plan information.

    Parameters

    Returns Promise<Result>

    • Promise that returns an object with time plan information.

getTimePlanTimePolicyIds

  • Assigns the time plan and time policy to a price list entry.

    Parameters

    • input: GetTimePlanPolicyIdsInput

      The pricing variable input with the remoteClass, remoteMethod, parameters and paramsArray function.

    Returns Promise<Result>

    • Promise that returns the time plan and time policy ids.

getTimePolicy

  • Gets Time Policy information.

    Parameters

    Returns Promise<Result>

    • Promise that returns an object with time policy information.

getVlocityAttachmentDetails

  • Get Vlocity Attachment details

    Parameters

    Returns Promise<Result>

    • Promise that returns a success or failure message.

getVlocityAttachments

  • Returns a list of VlocityAttachment records for a given productId. These records have the url (UrlLong__c) which can be used as a download link.

    API Path: (GET) /services/data/v43.0/query

    Parameters

    Returns Promise<Result>

    • Promise that resolves to a list of VlocityAttachment records.

preValidatePCIOverrideObject

  • This function will execute remote call to preValidate PCI Override Object

    Parameters

    Returns Promise<any>

publishProduct

  • Executes the remote action for publishing the product. This action would populate the JSONAttributes field of the product to ensure that the product attributes are visible in CPQ.

    Parameters

    Returns Promise<any>

saveAttributeAssignment

  • Calls the remote function to Save Attribute Assignment object.

    Parameters

    Returns Promise<Result>

saveAttributeOverride

  • This function will execute remote call to create override for an attribute

    Parameters

    Returns Promise<any>

searchProductsByText

  • Simple text search for products using SOSL on NAME FIELDS

    Parameters

    Returns Promise<any>

searchRelatedObjects

  • Parameters

    Returns Promise<any>

updateAttributeAssignments

  • Executes a remote call to update all attributes of a given object.

    Parameters

    Returns Promise<any>

updateObject

  • Executes remote call to update all fields of an object.

    Parameters

    Returns Promise<any>

updateProduct

  • This will update an existing product as provided in UpdateProductInput.

    Parameters

    Returns Promise<any>

updateProductAttribute

  • Sends a PUT request to update a single attribute on the product.

    API Path: (PUT) /v1/studio/products/{input.productId}/attributes

    Parameters

    Returns Promise<Result>

    • Promise that resolves to a Success message if the update was successful.

updateProductChildItem

  • This function updates fields and attribute values that are available for the corresponding ProductChildItem Id.

    API Path: (PATCH) /services/data/v43.0/sobjects/{namespacePrefix}ProductChildItem__c/{input.parentChildItemId}

    Parameters

    Returns Promise<any>

    • A promise that resolves to the list of available fields, attributes and attribute values.

updateProductDefinition

  • Posts the updated product definition (sections and sectionElements) to the api endpoint for updating a product.

    API Path: (PUT) /v1/studio/object/{input.productId}/facets/{input.facet}

    Parameters

    Returns Promise<Result>

    • Promise that resolves to the updated product definition.

updateProductField

  • Posts an update to the standard salesforce REST API for updating a single field on the Product2 Object.

    API Path: (PATCH) /services/data/v43.0/sobjects/Product2/{input.productId}

    Parameters

    Returns Promise<Result>

    • If update is successful, this would promise would have no content as API returns HTTP-204 (No content)

updateSalesforceDocument

  • updateSalesforceDocument(input: any): Promise<Result>
  • replaces document specified in the FormData with the old document. Request body is of type multipart/form-data

    API Path: (PATCH) /services/data/v43.0/sobjects/Document/${documentId}

    Parameters

    • input: any

    Returns Promise<Result>

    • Promise that would have no content.

updateSingleAttribute

  • Exepcutes remote call to update the settings for a given product id and attribute id.

    Parameters

    Returns Promise<Result>

updateVlocityAttachment

  • Get Vlocity Attachment details

    Parameters

    Returns Promise<Result>

    • Promise that returns a success or failure message.

uploadToSalesforce

  • Uploads files specified in the FormData to SalesForce Documents section. Request body is of type multipart/form-data

    API Path: (POST) /services/data/v43.0/composite/sobjects

    Parameters

    • input: FormData

    Returns Promise<BulkCreateResult[]>

    • Promise that resolves to a list of records that has the document ids of each of the uploaded documents.

version

  • version(): string
  • Returns the version number of SDK.

    Returns string

    Returns SDK version number as string

Static extend

  • extend(extendObj: object): void
  • Adds all the enumerable string keyed function properties of a source object to the sdk prototype. .extend should only be used to add new methods and it won't override the existing methods.

    Note: If the property already exists, it will be not be added.

    Custom functions which are being extended should have proper namespaces to avoid issues during upgrades. When Vlocity releases new changes it won't impact if unique namespaces are used.

    Example: myCompanyOrFeatureMethodName

    example

    How to extend an sdk?

    VlocitySDK.datasource.extend({ myCompanySayHello(){
         console.log("Hello World");
      }, sayTime() {
         console.log(new Date().myCompanyGetTime());
      }});
    
    const dataSource = VlocitySDK.datasource.getInstance({'create':true});
    console.log(daSource.myCompanySayHello())

    Parameters

    • extendObj: object

      The object of functions

    Returns void

Static getInstance

Static override

  • override(overrideObj: object): void
  • Adds all the enumerable string keyed function properties of a source object to the sdk prototype.

    .override method should only be used to override the existing methods and should only be used in rare cases. Overriding the existing or default methods may cause unintended consequences and may also impact during upgrades.

    Please be cautious while using this

    example

    How to override methods in an sdk?

    VlocitySDK.datasource.override({ soql(){
         console.log("This code overrides the default soql function");
         // code goes here...
      }, sosl() {
         console.log("This code overrides the default soql function");
         // code goes here...
      }});
    
    const dataSource = VlocitySDK.datasource.getInstance({'create':true});
    console.log(dataSource.soql()); // prints "This code overrides the default soql function"

    Parameters

    • overrideObj: object

      The object of functions

    Returns void

Generated using TypeDoc