Posts

Showing posts from July, 2024

Vlocity Facts #44 || Communication between Omniscript and Flexcard [Pub/Sub]

Image
Flexcards have the ability to trigger and listen to two kinds of events: Custom and Pubsub events . Custom Events: Facilitate the transmission of information between a child and its parent. This can occur between a child Flexcard and its parent Flexcard, or between an element and the Flexcard to which it belongs. Pubsub Events: Allows communication between two separate components. This could occur between two separate Flexcards on the same Lightning page, known as sibling Flexcards, or between a Flexcard and an Omniscript.  In this post I will discuss about Pub/Sub event. Consider we have omniscript and flexcard individually on home page when an update happens we need to show those details in flexcard. To achieve this we can use pub/sub event. Step 1: Create a omniscript according to your requirement. I'm trying to create Contact record by using Step element and data raptor post action. Now to trigger the flexcard we need to configure the messaging frame work when an update happen...

Vlocity Facts #43 || How to pass recordId from Utility Items to Omniscript by using LWC

Image
In one of the previous post I have discussed about how to launch omniscript from Utility Items. [ How to call Omniscript from Utility Items ] If we need to refer current page recordId in omniscript and perform logic, we can't achieve that by using standard method mentioned in above link. To overcome this we need to launch omniscript from the LWC. Let's see how to launch omniscript from LWC. 1. Create Omniscript according to your requirement. For example I'm fetching account details and displaying. 2. Pass ContextId as the Data Source to DataRaptor. 3. From top right side of the omniscript click on how to launch button and copy the first link. We will use that in LWC. 4. Now create LWC to Launch the omniscript and paste the copied URL as shown. 5. Now open js file of the LWC and copy below code. import  {  LightningElement ,wire, track,api }  from   'lwc' ; import  {  CurrentPageReference  }  from   "lightning/navigation" ; import ...