1

I am trying to use my custom account record creating aura component. It is opened when user push New account button. In desktop everything works correct, but in mobile i have this error: enter image description here

Action failed: c:NewAccountFromSpark$controller$doInit [undefined is not an object (evaluating 'base64Context.startsWith')] Callback failed: aura://ComponentController/ACTION$getComponent

doInit in my aura controller is:

doInit : function(component, event, helper) {
    let isModalPopup = component.get('v.isModalPopup');
    let pageReference = component.get("v.pageReference");
    let currentRecordTypeId = component.get("v.recordTypeId");
    if (pageReference) {
        let recordTypeId = component.get("v.pageReference").state.recordTypeId;
        if (recordTypeId !== currentRecordTypeId) {
            component.set('v.isModalPopup', true);
            component.set('v.recordTypeId', recordTypeId);
            let base64Context = component.get("v.pageReference").state.inContextOfRef;
            if (base64Context.startsWith("1\.")) {
                base64Context = base64Context.substring(2);
            }
            let inContextOfRef = JSON.parse(window.atob(base64Context));
            component.set('v.refererContext', inContextOfRef);
            component.find('createAccountFromSpark').updateFields();
        }
    } else if (isModalPopup === true) {
        component.set('v.isModalPopup', false);
    }

    let rerenderLwcComponent = component.get('v.rerenderLwcComponent');
    if (rerenderLwcComponent) {
        component.set('v.rerenderLwcComponent', false);
        component.set('v.renderLwcComponent', false);
        component.set('v.renderLwcComponent', true);
    }
}

May somebody help me to solve this issue? Thanks

1
  • I have the same issue. Did you solve it ? Jun 27, 2022 at 2:26

0

You must log in to answer this question.

Browse other questions tagged .