Custom Component Interaction with Renderer
Digital Twin Action Metadata: Customizing Your DigitalTwin LWC Component Experience
As you dive deep into the immersive world of asset visualization with the RenderDraw Digital Twin package, we understand that customization is crucial. That's why we've introduced the Custom Metadata Type: RenderDraw Digital Twin Action, allowing Salesforce administrators to tailor the DigitalTwin component's UI to meet specific business needs.

Here's a quick guide to understanding and utilizing these settings:

Fields Overview:
Label: Assign a unique name to the action
This will be your reference point
RenderDraw Digital Twin Action Name: Auto populates based on Label field
Display in Popup: Decide where you want the action to display
If set to
true
, your action will appear in a pop-up window that overlays the drawingIf set to
false
, it will be neatly integrated into a sidebar alongside the drawing
Flow Name: Input the API name of the Lightning flow you wish to display
This is typically a screen flow tailored for the chosen action
Action Label: Craft a user-friendly label
This is what your users will see in the action menu when they wish to invoke your flow
Action Icon: Define the look of your action using any Salesforce icon name
This icon will be showcased in the action menu
Order: Determine the sequence of your action in the context menu.
A lower order will prioritize its position
RenderDraw Digital Twin Settings: Link your action to a specific digital twin setting
This dictates when your action will be displayed
Interacting with the DigitalTwin Component:
When designing your custom flows, remember to set up string input parameters for both recordId
and contextId
. These parameters are essential to retrieve relevant data and ensure seamless interaction between the flow and the DigitalTwin component.
Advanced: Interacting with the Renderer
For those looking to create even more dynamic interactions, our renderer's public API is at your disposal. Utilize the following format to call any of our public API methods:
const payload = {
contextId: this.contextId,
name: "showToastNotification",
parameters: {
title: this.title,
mode: this.mode,
message: this.message,
messageTemplate: this.messageTemplate,
iconName: this.iconName,
type: this.type,
duration: this.duration,
messageTemplateData: this.messageTemplateData
}
};
publish(this.messageContext, CANVAS_INTERACTION_CHANNEL, payload);
To facilitate these interactions, ensure you have the necessary imports in your module:
import { publish, subscribe, MessageContext } from "lightning/messageService";
import CANVAS_INTERACTION_CHANNEL from "@salesforce/messageChannel/RDraw__Canvas_Interaction__c";
The RenderDraw Digital Twin package offers you a world of customizability. By understanding and leveraging the Digital Twin Action metadata, you can enhance the user experience and meet the unique demands of your business. Dive in, customize, and let your DigitalTwin component truly reflect your vision.
Last updated