function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
VSK98VSK98 

Component.set is not working

Hi All,

I display the list of records in a lightning page. When the user clicks on Account name (hyperlink), it will redirect to another page and the account name value is passing from parent to child component using aura method. I can get the account name to child component but I couldn't able to make assign the value to another attribute. 
Snippet Code:
executeMyMethod : function(component, event, helper) {
         var params = event.getParam('arguments');
        console.log('Param : '+ params);-------- Getting Account Name
        var  s = params; ---- Assign the value to S
        alert(s); ---- Getting Account Name
        var cus = component.set("v.customer", params); ----setting the value
		 console.log('cus : '+ cus); --- Getting Undefine

Please help me with this.

Adv Thanks,
VSK98
Raj VakatiRaj Vakati
try this code
console.log('cus : '+ component.get("v.customer")); --- Getting Undefine

executeMyMethod : function(component, event, helper) {
	 var params = event.getParam('arguments');
	console.log('Param : '+ params);-------- Getting Account Name
	var  s = params; ---- Assign the value to S
	alert(s); ---- Getting Account Name
	var cus = component.set("v.customer", params); ----setting the value
	 console.log('cus : '+ component.get("v.customer")); --- Getting Undefine

 
VSK98VSK98
Hi Raj,

Thanks for the response!!

I tried with your code and I can get the value but I couldn't set into another attribute using COMPONENT.SET....
Regards,
VSK98