Options
All
  • Public
  • Public/Protected
  • All
Menu

Exposes SDK functions get object details and save object details

Hierarchy

  • VlocityObjectDetails

Index

Constructors

constructor

Properties

attributeAssignments

attributeAssignments: any[] = []

Private cacheExpiration

cacheExpiration: Date = new Date(new Date().getTime() + 24 * 60000)

config

isVersioningEnabled

isVersioningEnabled: boolean = false

mockSections

mockSections: IObjectSection[]

Methods

amendProduct

  • amendProduct(objectId: string, sections: IObjectSection[], productData: any): Promise<any>
  • Parameters

    Returns Promise<any>

createObject

  • createObject(objectName: string, sections: IObjectSection[], isObjectType: boolean): Promise<unknown>
  • Transforms section elements into the Salesforce object and invokes the createObject remote action to create the object.

    example
    const objectDetails = VlocitySDK.productconsole.getInstance().vlocityObjectDetails();
    objectDetails.createObject('Product2', sections).then((updatedObject) => {
      render();
    })

    Parameters

    Returns Promise<unknown>

findSectionElement

  • findSectionElement(sections: any, fieldApiName: any): any
  • Finds the specified section

    Parameters

    • sections: any

      list of sections on which the find has to be made

    • fieldApiName: any

      fieldApiName of the required section

    Returns any

    sectionElement

Private getAttributeAssignmentId

  • getAttributeAssignmentId(assignments: any, sectionElement: any): string
  • Parameters

    • assignments: any
    • sectionElement: any

    Returns string

Private getDataType

  • getDataType(sectionElement: any, attr: any, describeObject: any): string
  • Parameters

    • sectionElement: any
    • attr: any
    • describeObject: any

    Returns string

getDependentPicklistDetails

  • getDependentPicklistDetails(recordTypeId: string, nsp?: string): Promise<Result>
  • Get dependent picklist details using ui-api

    Parameters

    • recordTypeId: string

      The recordTypeId to fetch details.

    • Default value nsp: string = userTestData.namespacePrefix

    Returns Promise<Result>

    • Promise that returns a success or failure message.

Private getDescribeObjectById

  • getDescribeObjectById(objectId: any): Promise<any>
  • Parameters

    • objectId: any

    Returns Promise<any>

Private getDescribeObjectByName

  • getDescribeObjectByName(objectName: string): Promise<any>
  • Parameters

    • objectName: string

    Returns Promise<any>

Private getElementValue

  • getElementValue(sectionElement: any, objData: any, attr: any, isNewObject: any): any
  • Parameters

    • sectionElement: any
    • objData: any
    • attr: any
    • isNewObject: any

    Returns any

Private getInputType

  • getInputType(sectionElement: any, attr: any, describeObject: any): string
  • Parameters

    • sectionElement: any
    • attr: any
    • describeObject: any

    Returns string

Private getLayoutByObjectId

  • getLayoutByObjectId(objectId: any): Promise<any>
  • Parameters

    • objectId: any

    Returns Promise<any>

Private getLayoutByObjectName

  • getLayoutByObjectName(objectName: string): Promise<any>
  • Parameters

    • objectName: string

    Returns Promise<any>

Private getLookupObjectName

  • getLookupObjectName(fieldApiName: any, describeObject: any): any
  • Parameters

    • fieldApiName: any
    • describeObject: any

    Returns any

getNewObject

  • getNewObject(objectName: string): Promise<unknown>
  • Makes the necessary remote actions for getting data needed when creating a new object and returns the section elements.

    example
    const objectDetails = VlocitySDK.productconsole.getInstance().vlocityObjectDetails();
    objectDetails.getNewObject('Product2').then((layoutSections: IObjectSection[]) => {
      render();
    })

    Parameters

    • objectName: string

    Returns Promise<unknown>

Private getObject

  • getObject(objectId: string): Promise<any>
  • Parameters

    • objectId: string

    Returns Promise<any>

getObjectById

  • getObjectById(objectId: string, objectName: string): Promise<unknown>
  • Calls multiple remote actions and returns a simplified JSON structure that can be used with object layout.

    example
    const objectDetails = VlocitySDK.productconsole.getInstance().vlocityObjectDetails();
    objectDetails.getObjectById('1234', 'Product2').then((layoutSections: IObjectSection[]) => {
      render();
    })
    throws

    {Error} - "Object Id and Object name are required to get object details by id."

    Parameters

    • objectId: string

      Id of the salesforce object.

    • objectName: string

      of the salesforce object.

    Returns Promise<unknown>

getObjectPicklistsByName

  • getObjectPicklistsByName(objectName: any): Promise<any>
  • Parameters

    • objectName: any

    Returns Promise<any>

Private getOrCreateAttributeAssignments

  • getOrCreateAttributeAssignments(layout: any, objectId: any): Promise<any>
  • Parameters

    • layout: any
    • objectId: any

    Returns Promise<any>

Private getPicklistItems

  • getPicklistItems(sectionElement: any, aaWrapper: any, picklists: any): any
  • Parameters

    • sectionElement: any
    • aaWrapper: any
    • picklists: any

    Returns any

Private getRefValue

  • getRefValue(objectData: any, sectionElement: any): object
  • Parameters

    • objectData: any
    • sectionElement: any

    Returns object

    • Id: any
    • Name: any

Private getRemoteActionErrors

  • getRemoteActionErrors(responses: any): any[]
  • Parameters

    • responses: any

    Returns any[]

Private getSectionElements

  • getSectionElements(section: any, objectData: any, describeObject: any, picklists: any, attributeAssignments: any, isNewObject?: boolean): IObjectSectionElement[]
  • Parameters

    • section: any
    • objectData: any
    • describeObject: any
    • picklists: any
    • attributeAssignments: any
    • Optional isNewObject: boolean

    Returns IObjectSectionElement[]

getVersioningEnabled

  • getVersioningEnabled(): Promise<any>
  • Returns Promise<any>

isAttributeAssignmentChanged

  • isAttributeAssignmentChanged(attr: any): any
  • Parameters

    • attr: any

    Returns any

isElementDisabled

  • isElementDisabled(sectionElement: any, objectData: any): boolean
  • Parameters

    • sectionElement: any
    • objectData: any

    Returns boolean

Private saveAttributeAssignments

  • saveAttributeAssignments(attributeAssignments: any): any[]
  • Parameters

    • attributeAssignments: any

    Returns any[]

saveObject

  • saveObject(objectId: string, sections: IObjectSection[], globalGroupKey: any): Promise<any>
  • Saves the object and all the related attribute values. This function is called when user clicks save on the details tab of the object.

    example
    const objectDetails = VlocitySDK.productconsole.getInstance().vlocityObjectDetails();
    objectDetails.saveObject("1234", sections).then(() => {
    this.render()
    })```
    
    @returns {Promise<any>}
    @throws {Error} - "Object Id and a non-empty sections array is required to save an object."

    Parameters

    • objectId: string

      Id of the salesforce object

    • sections: IObjectSection[]

      Updated section element values.

    • globalGroupKey: any

    Returns Promise<any>

storeProductGlobalGroupKey

  • storeProductGlobalGroupKey(objectData: any): void
  • Parameters

    • objectData: any

    Returns void

storeProductLifecycleStatus

  • storeProductLifecycleStatus(objectData: any): void
  • Parameters

    • objectData: any

    Returns void

transformDependentPicklistResponse

  • transformDependentPicklistResponse(input: any): object
  • Transforms the response from getDependentPicklistDetails

    Parameters

    • input: any

      response containing dependent picklist details

    Returns object

transformServiceResponse

  • transformServiceResponse(layout: any, picklists: any, describeObject: any, objectData: any, attributeAssignments: any, isNewObject?: boolean): IObjectSection[]
  • Parameters

    • layout: any
    • picklists: any
    • describeObject: any
    • objectData: any
    • attributeAssignments: any
    • Optional isNewObject: boolean

    Returns IObjectSection[]

updateAttributeAssignments

  • updateAttributeAssignments(responses: any): void
  • Parameters

    • responses: any

    Returns void

Generated using TypeDoc