You need to sign in to do that
Don't have an account?

Lightning - Expense tracker - Not working as expected
Hi,
Completed the Expense tracker labs , but encountered following two issues
1. Submit button seems to be non responsive , nothing happens when you click it.
2. Event seems to fire but gives an exception "Internal server error".
Anyone able to do this without any issues? If so please share code.
Completed the Expense tracker labs , but encountered following two issues
1. Submit button seems to be non responsive , nothing happens when you click it.
2. Event seems to fire but gives an exception "Internal server error".
Anyone able to do this without any issues? If so please share code.
Are you seeing any errors in the browser console or Logs tab of your Dev Console? If you leave the fields empty and hit the Submit button, does your app warns you of an empty amount field per #2 of https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/qs_aotp_app_step5_cmp_detail.htm (https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/qs_aotp_app_step5_cmp_detail.htm" target="_blank)? That would at least tell if createExpense in formController.js is being called correctly before you check your code in formHelper.js. You might also want to check that upsertExpense in formHelper is calling your Apex controller correctly since the server trip has to happen first before that record is displayed.
Is your code finding the "amount" field at this point? You can try to add console.log(amt) after amtField.get("v.value") to see if the value is being captured. This field should correspond to aura:id on the ui:inputNumber component in form.cmp.
If your createExpense code in formController.js is correct, it should call helper.createExpense in formHelper.js. This helper then gets the saveExpense Apex controller, which saves the new record, and updates the app UI via
component.set("v.expenses", expenses); in helper.createExpense. Hope this helps you find the problem. It would be easier for you to debug the event error if you get this record creation part fixed first. Good luck!
i have the same Problem. My Button dont fired.
When I turn on the console.log(amt) after amtField.get("Value") nothing happens. Why?
thanks
I'm getting this issue at present - when I remove the expense name, the validation fires but the button doesn't seem to actually do anything other than that (even when all fields are legitimately completed). Should I be getting redirected? I cannot see any items in my expenses object in SF.
I have copied the code several times and still end up with the same..
Emma, your solution did not work either :-(
Thanks,
Susan
I am using Safari (so, sue me!) I copied and pasted the code, and clicked the button - nothing happened. The Name field validation error appeared when I didn't enter a value.
I didn't realise that I had the console set to display "errors", as soon as I switched it to "logs" I could see the JSON object.
I guess when you read the trailhead:
"First, let’s create a place to “store” new expenses. We’ll simply create a local-only array of expenses to hold them. At the top of expenses component markup, right before the newExpense attribute, add a new expenses attribute, which will hold an array of expense objects."
So we aren't really doing anything dynamic yet - I guess the button isn't supposed to 'work' just yet - maybe the next module.
yeah?