Skip to main content
1 of 4
Sarang
  • 2.7k
  • 8
  • 55
  • 102

Error: Something has gone wrong. Cannot read property 'Ud' of undefined. Please try again. in lightning

I am getting above error for following code: Can anybody please help...its a >short code I believe I have checcked for typos!!

component:

<aura:component >

<aura:attribute name="Result" type="Integer" />
<ui:inputNumber aura:id="inputOne" label="Enter first number" />
<ui:inputNumber aura:id="inputTwo" label="Enter second number" />
<ui:inputNumber aura:id="inputThree" label="Enter third number" />
<ui:button aura:id="calculateButton" label="Calculate" press="{!c.calculate}"    />

<div>
    Output: <ui:outputNumber aura:id= "totalValue" value="{!c.Result}" />
</div>

</aura:component>

Controller:

({
calculate : function(component, event, helper) {
    var a= component.find('inputOne').get('v.value');
    var b= component.find('inputTwo').get('v.value');
    var c= component.find('inputThree').get('v.value');
    
    var resultCalc=a+b-c;
    //console.log('Values are: '+a+b+c+result);
    component.set("v.Result", resultCalc);
}
})

Application:

<aura:application >
<c:CalculateTotal />

</aura:application>

Sarang
  • 2.7k
  • 8
  • 55
  • 102