liuyn
2024-03-11 a87f1c3df03078814ee97ad0c8ac200a232419e9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<apex:page standardController="Campaign" showHeader="false" sidebar="false" id="lwcContainer" lightningStylesheets="true">
    <apex:includeLightning /> 
     <div id="lwcContainer" /> 
    <script type="text/javascript">
        var opdId = "{!$CurrentPage.parameters.id}";    
        $Lightning.use("c:lexOPDPlanProdApp", function () {
            $Lightning.createComponent("c:lexOPDPlanProd",
                {"recordId" : opdId},
                "lwcContainer",
                function(cmp) {
                    window.addEventListener('customEventName', function(event) {
                        var message = event.detail.message;
                        var type = event.detail.type;
                        if(message !== null){
                             sforce.one.showToast({
                                message: message,
                                type: type,
                            });
                        }
                    });
                }
            );
        });
    </script>
</apex:page>