Options
All
  • Public
  • Public/Protected
  • All
Menu

Product Console Facade to interact with Vlocity Product Console functionality.

version

v107

Hierarchy

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

Properties

Private cacheExpiration

cacheExpiration: Date = ...

Private config

config: default

Configuration for this SDK.

Static Private instance

instance: default

Singleton instance of this SDK.

Static Private productOverrideSDK

productOverrideSDK: ProductOverride

Singleton instance of ProductOverride SDK.

Static Private productPricingSDK

productPricingSDK: ProductPricing

Singleton instance of ProductPricing SDK.

Static Private productStructureSDK

productStructureSDK: ProductStructure

Singleton instance of ProductStructure SDK.

Static Private versioningSdk

versioningSdk: Versioning

Singleton instance of Version SDK.

Static Private vlocityAttributesSDK

vlocityAttributesSDK: VlocityAttributes

Singleton instance of Vlocity Attributes SDK.

Static Private vlocityObjectDetails

vlocityObjectDetails: VlocityObjectDetails

Singleton instance of object details sdk.

Static Private vlocityObjectSDK

vlocityObjectSDK: VlocityObject

Singleton instance of VlocityObject 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

createAttributeAssignments

  • Parameters

    Returns Promise<any>

createCreateSalesforceDocumentInput

createCreateVlocityAttachmentsInput

  • Creates and returns input object for creating VlocityAttachment objects.

    Returns CreateVlocityAttachmentsInput

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

createDeleteVlocityAttachmentInput

  • Creates and returns an instance of input class for DeleteVlocityAttachmentInput

    Parameters

    • attachmentId: any

    Returns DeleteVlocityAttachmentInput

createGetAppliedFieldsAndAttributesInput

createGetObjectDescriptionInput

createGetObjectPicklistsInput

  • Returns an instance of GetObjectPicklistisInput class

    Returns GetObjectPicklistsInput

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.

createGetProductsInput

  • Creates and returns Input object for getting products

    Returns GetProductsInput

    • Returns the default input object for getProducts sdk function.

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

createPublishProductInput

  • Creates the input object for publishProduct remote action.

    Returns PublishProductInput

createQuickAddProductPropertiesInput

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

    Returns GetQuickAddProductPropertiesInput

createSaveAttributeAssignmentInput

createSearchRelatedObjectsInput

  • Returns the input instance getSearchResults sdk function.

    Returns SearchRelatedObjectsInput

createSimpleProductsSearchInput

  • Creates the input object for searchProductByText remote action.

    Returns SimpleProductSearchInput

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.

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.

deleteVlocityAttachment

  • Vlocity Attachment delete

    Parameters

    Returns Promise<Result>

    • Promise that returns a success or failure message.

fire

  • fire(eventName: any, action: any, payload: any): void
  • Fires an event to listeners.

    Parameters

    • eventName: any

      Name of the event to fire.

    • action: any

      Name of the event to fire.

    • payload: any

      Payload of the event to fire.

    Returns void

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>

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

getPriceList

  • This function returns a list of price list.

    Parameters

    Returns Promise<Result>

    • Promise that returns the price list.

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.

getProduct2Object

  • Returns Id for Product2 object

    Parameters

    Returns Promise<Result>

    • Promise that resolves to the Id of Product2 object.

getProductAttributeAssignments

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.

getProductOverrideSdk

  • Gets an instance of ProductOverride SDK.

    summary

    ProductOverride SDK contains all the methods related to override functionality

    Returns ProductOverride

    an instance of ProductOverride SDK.

getProductPricingSdk

  • Gets an instance of ProductStructure SDK.

    summary

    ProductStructure SDK contains all the methods related to product structure

    Returns ProductPricing

    an instance of ProductStructure SDK.

getProductStructureSdk

  • Gets an instance of ProductStructure SDK.

    summary

    ProductStructure SDK contains all the methods related to product structure

    Returns ProductStructure

    an instance of ProductStructure SDK.

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.

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.

getVersioningSdk

  • Gets an instance of Version SDK.

    summary

    Versioning SDK contains all the methods related to object type versioning.

    Returns Versioning

    an instance of Version SDK.

getVlocityAttachmentDetails

  • Get Vlocity Attachment details

    Parameters

    Returns Promise<Result>

    • Promise that returns a success or failure message.

getVlocityAttachmentsRemoteAction

  • 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.

getVlocityAttributesSdk

  • Gets an instance of VlocityAttributes SDK.

    summary

    VlocityAttributes SDK contains all the methods related to vlocity attributes definition

    Returns VlocityAttributes

    an instance of VlocityAttributes SDK.

getVlocityObjectSdk

  • Gets an instance of VlocityObject SDK.

    summary

    VlocityObject SDK contains all the methods related to vlocity object

    Returns VlocityObject

    an instance of VlocityObject SDK.

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>

register

  • register(eventName: any, callbackobj: any): void
  • Registers a callback for an event

    Parameters

    • eventName: any

      Name of the event to listen for.

    • callbackobj: any

      Contains callback function.

    Returns void

saveAttributeAssignment

  • Calls the remote function to Save Attribute Assignment object.

    Parameters

    Returns Promise<Result>

searchProductsByText

  • Simple text search for products using SOSL on NAME FIELDS

    Parameters

    Returns Promise<any>

searchRelatedObjects

  • Parameters

    Returns Promise<any>

unregister

  • unregister(eventName: any, callbackobj: any): void
  • Unregisters a callback for an event

    Parameters

    • eventName: any

      Name of the event to unregister from.

    • callbackobj: any

      Contains callback function.

    Returns void

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>

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.

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)

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

    Returns Promise<any>

    • 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

vlocityObjectDetails

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

  • Get a singleton instance of this SDK.

    Parameters

    Returns default

    an instance of this SDK.

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