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

How do I update a record in the prodList?
Hi,this function takes as input a value (Quantity) this value must be subtracted from the value of the Available Quantity field contained in the "prodList" list filtered by the id, with the result of the subtraction "rquantity" must be inserted (update) in the list " v.prodList "passing the id. How can it be done?
Controller:
Controller:
yesBtn : function(component,event,helper){ var qty=component.find("prova").get("v.value"); var name=component.get("v.Name"); var cr=component.get("v.id"); var aquantity=component.get("v.AQuantity"); console.log("id book "+component.get("v.id")); if(qty>aquantity){ var toastEvent = $A.get("e.force:showToast"); toastEvent.setParams({ title : 'Error', message: 'the quantity you want exceeds that available', duration:' 5000', key: 'info_alt', type: 'Error', mode: 'pester' }); toastEvent.fire(); } else{ var rquantity=aquantity-qty; console.log("Available quantity - quantity = " +rquantity); }
This seems to be duplicate for the below question.
https://developer.salesforce.com/forums?dc=Apex_Code_Development#!/feedtype=SINGLE_QUESTION_DETAIL&dc=General_Development&criteria=ALLQUESTIONS&id=9062I000000UceP (https://developer.salesforce.com/forums?dc=Apex_Code_Development#!/feedtype=SINGLE_QUESTION_DETAIL&dc=General_Development&criteria=ALLQUESTIONS&id=9062I000000UceP)
Please allow some time for the experts to answer your question as duplicatating the question may cause the duplicate efforts.
Please close this question by marking it as best answer.
Thanks,
And try to give a simple code next time which can be understood and run easily. Also your code is complex, try to break it into different module, do not add this much code in one single file. TellCulvers (https://www.tellculvers.onl/)
Dinar Guru (https://www.dinarguru.biz/)