You need to sign in to do that
Don't have an account?
Abby Stocker
Error while creating component for lightning component quick action.
Please help with the following error, Thank you so much.
ERROR:
Error while creating component for lightning component quick action [Unable to find action 'PhysicalInventoryClaimPDF' on the controller of c:PhysicalInventoryClaimPDF]
COMPONENT:
<aura:component description="PhysicalInventoryClaimPDF" controller="PhysicalInventoryPDFController" implements="force:lightningQuickAction,force:hasRecordId">
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<aura:attribute name="recordId" type="Id"/>
<aura:attribute name="documentId" type="Id"/>
<aura:attribute name="documentCreated" type="Boolean"/>
<div>
<lightning:fileCard fileId="{!v.documentId}" description="{!'Loss and Damage Claim Form'}"/>
</div>
</aura:component>
CONTROLLER:
({
doInit: function (component, event, helper) {
helper.getPdfToDownload(component);
},
savePdf: function (component, event, helper) {
console.log('SAVING');
},
});
HELPER:
({
getPdfToDownload: function (component) {
var getPdfAction = component.get("c.PhysicalInventoryClaimPDF");
getPdfAction.setParams({
claimId: component.get("v.recordId")
});
getPdfAction.setCallback(this, function (response) {
var responseState = response.getState();
if (responseState === "SUCCESS") {
component.set("v.documentId", response.getReturnValue());
component.set("v.documentCreated", true);
} else {
alert("Error message: " + JSON.stringify(response.getError()));
}
});
$A.enqueueAction(getPdfAction);
}
});
ERROR:
Error while creating component for lightning component quick action [Unable to find action 'PhysicalInventoryClaimPDF' on the controller of c:PhysicalInventoryClaimPDF]
COMPONENT:
<aura:component description="PhysicalInventoryClaimPDF" controller="PhysicalInventoryPDFController" implements="force:lightningQuickAction,force:hasRecordId">
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<aura:attribute name="recordId" type="Id"/>
<aura:attribute name="documentId" type="Id"/>
<aura:attribute name="documentCreated" type="Boolean"/>
<div>
<lightning:fileCard fileId="{!v.documentId}" description="{!'Loss and Damage Claim Form'}"/>
</div>
</aura:component>
CONTROLLER:
({
doInit: function (component, event, helper) {
helper.getPdfToDownload(component);
},
savePdf: function (component, event, helper) {
console.log('SAVING');
},
});
HELPER:
({
getPdfToDownload: function (component) {
var getPdfAction = component.get("c.PhysicalInventoryClaimPDF");
getPdfAction.setParams({
claimId: component.get("v.recordId")
});
getPdfAction.setCallback(this, function (response) {
var responseState = response.getState();
if (responseState === "SUCCESS") {
component.set("v.documentId", response.getReturnValue());
component.set("v.documentCreated", true);
} else {
alert("Error message: " + JSON.stringify(response.getError()));
}
});
$A.enqueueAction(getPdfAction);
}
});