0

I am receiving below error when I am trying to upload a .FNM file in my community. No code has been changed but it is working in Production with same code but not in sandboxes, does this have something to do with the new release?

enter image description here

This is my lightning component, it is reading the data in the file but is running into error loop,

Lightning component Controller:

    ({
        Loan_Obj1: function (component, event, helper, applicationDate) {
            debugger;
            var fileInput = component.find("file").getElement();
            var file = fileInput.files[0];

            var spinner = component.find("spinner");
            $A.util.toggleClass(spinner, "slds-hide");
            var data = component.get("v.filedata");

            var dd = document.getElementById('inputtxt').value;
            var action = component.get("c.getFNMData");
            action.setParams({
                "filedata": dd,
                fileName: file.name,
                base64Data: encodeURIComponent(data),
                contentType: file.type,
                applicationDate: applicationDate
            });
            action.setCallback(this, function (a) {
                debugger; 
   /*********** IT IS RUNNING INTO ERROR HERE BUT SKIPPING THESE LINE IN PROD*********/ 
            var errors = action.getError();
            if (errors && errors[0]) {    
                console.error("getFNMData error", errors);
                // display error in toast
                var toastEvent = $A.get("e.force:showToast");
                toastEvent.setParams({
                    "type": "error",
                    "mode": "sticky",
                    "title": "Upload Failed!",
                    "message": errors[0].message
                });
                toastEvent.fire();
                // hide loading spinner
                var spinner = component.find("spinner");
                $A.util.toggleClass(spinner, "slds-hide");    
            } else {
                debugger;
                var Id = a.getReturnValue();
                var evt = $A.get("e.c:NavigatetoLoanMenu");
                evt.setParams({ LoanId: Id });
                evt.fire();
            }
        });
        $A.enqueueAction(action);
    },

Can anyone suggest what must be causing this issue only in lower environments, let me know if I have to add more code, thanks in advance.

  • Is your sandbox on Spring ‘19? If anything has not changed from code perspective, then you may like to reach out to Salesforce. – Jayant Das Jan 18 at 0:36
  • Yes it is on Spring '19. I'll check with Salesforce then, thank you.. – user62694 Jan 18 at 0:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.