我创建了一个具有嵌入式仪表板的闪电组件

时间:2019-10-21 07:33:35

标签: salesforce salesforce-lightning

需要在光环组件中显示嵌入式仪表板

我已经完成了代码部分,但由于与访问相关的问题,仪表板不会出现。我已经启用了所有访问权限,但仍然找不到使它正常工作的方法

组件文件:

({
    doInit: function(component, event, helper) {
    var config = {
        "developerId" : '01Z7F0000011SMYUA2',
        "showHeader": false,
        "showTitle": false,
        "height": 400
    };
    $A.createComponent("wave:waveDashboard", config,
        function(dashboard, status, err) {
            if (status === "SUCCESS") {
                dashboard.set("v.rendered", true);
                dashboard.set("v.showHeader", false);
                component.set("v.body", dashboard);
            } else if (status === "INCOMPLETE") {
                console.log("No response from server or client is offline.")
            } else if (status === "ERROR") {
                console.log("Error: " + err);
            }
        }
    );
}
})
<aura:component description="WaveContainer" 
                implements="force:appHostable,force:hasRecordId,flexipage:availableForAllPageTypes" 
                access="global">

    <!-- handlers -->
    <aura:handler name="init" 
                  value="{!this}" 
                  action="{!c.doInit}"/>
    {!v.body}
</aura:component>


<aura:component description="WaveContainer" 
            implements="force:appHostable,force:hasRecordId,flexipage:availableForAllPageTypes" 
            access="global">

    <!-- handlers -->
    <aura:handler name="init" 
                  value="{!this}" 
                  action="{!c.doInit}"/>
    {!v.body}
</aura:component>

JavaScript处理程序文件

({
    doInit: function(component, event, helper) {
    var config = {
        "developerId" : '01Z7F0000011SMYUA2',
        "showHeader": false,
        "showTitle": false,
        "height": 400
    };
    $A.createComponent("wave:waveDashboard", config,
        function(dashboard, status, err) {
            if (status === "SUCCESS") {
                dashboard.set("v.rendered", true);
                dashboard.set("v.showHeader", false);
                component.set("v.body", dashboard);
            } else if (status === "INCOMPLETE") {
                console.log("No response from server or client is offline.")
            } else if (status === "ERROR") {
                console.log("Error: " + err);
            }
        }
    );
}
})

将组件添加到页面后尝试查看该组件时,出现以下错误:

  

"The asset cannot be displayed because you don't have sufficient permissions."

0 个答案:

没有答案
相关问题