Salesforce 控制器卡在组件上。获取(“v.recordId”)
我试图使用lightning按钮获取案例记录Id,但我的控制器没有从此行向前移动-component.get(“v.recordId”) 我不知道怎么了 请帮助: 这是我的组件Salesforce 控制器卡在组件上。获取(“v.recordId”),salesforce,salesforce-lightning,Salesforce,Salesforce Lightning,我试图使用lightning按钮获取案例记录Id,但我的控制器没有从此行向前移动-component.get(“v.recordId”) 我不知道怎么了 请帮助: 这是我的组件 <aura:component controller="EmailSendController" implements="flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction" access="global">
<aura:component controller="EmailSendController" implements="flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction" access="global">
<lightning:button label="Send Notification" title="Send Notification" onclick="{!c.sendMail}"/>
})JavaScript区分大小写。第二个
Console
应该是小写的,我怀疑它会抛出一个关于未定义对象的错误
您可以使用浏览器JS控制台(在Chrome Ctrl+Shift+J中)检查此类错误。进入设置->调试模式并在其中添加用户也很有帮助。SF的速度会慢一点,但您将看到更多的可读代码和错误,而不是优化、缩小的混乱
如果它仍然抛出错误-使用控制台来检查到底是什么错误并编辑您的问题
另外,在回调处理程序中也更改它JavaScript区分大小写。第二个
Console
应该是小写的,我怀疑它会抛出一个关于未定义对象的错误
您可以使用浏览器JS控制台(在Chrome Ctrl+Shift+J中)检查此类错误。进入设置->调试模式并在其中添加用户也很有帮助。SF的速度会慢一点,但您将看到更多的可读代码和错误,而不是优化、缩小的混乱
如果它仍然抛出错误-使用控制台来检查到底是什么错误并编辑您的问题
另外,在回调处理程序中也更改它很高兴我能帮忙:)很高兴我能帮忙:)
({
sendMail: function(component, event, helper) {
console.log("Button Clicked--");
var caseID = component.get("v.recordId");
Console.log("CaseID--"+ component.get("v.recordId") );
var action = component.get("c.sendMailMethod");
action.setParams({
"caseId" : caseID
});
action.setCallback(this, function(response) {
var state = response.getState();
Console.log("Response"+response.getState());
if (state === "SUCCESS") {
//var storeResponse = response.getReturnValue();
}
});
$A.enqueueAction(action);
},