Vlocity Facts #54 || How to Invoke a DataMapper from LWC in Omnistudio (Vlocity)
Instead of writing custom Apex classes and their associated test classes, developers can use DataMappers within LWCs to handle data operations in a more efficient, declarative way. DataMappers are designed to read, transform, and write Salesforce data without the need for extensive Apex logic. They provide a low-code approach to data integration, which simplifies development and reduces dependency on custom code. To call a DataMapper from a custom Lightning Web Component (LWC), we use the getDataHandler method provided by Omnistudio’s. This method handles communication with backend services like DataRaptors, Integration Procedures. import { LightningElement } from "lwc"; import { OmniscriptBaseMixin } from "omnistudio/omniscriptBaseMixin"; //replace omnistudio with vlocity_ins/vlocity_cmt or with your installed package namespace import util from "omnistudio/utility"; We need to create the request data and input parameters and pass it to getDataHandl...