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
UjwalaUjwala 

Assign value to relationship lookup

Hi all,
I am getting this error for following code. Where C__FKClient__c and Owner__c are user lookup. I want to set email field value to C__FKClient__c from Owner__c
                           

                                inc=new C__FKClient__c();
                                inc.C__FKClient__c = pendingresponse[i].wrap_input.Owner__c;
                                string clienEmail= pendingresponse[i].wrap_input.Owner__r.email;
                                system.debug(clienEmail); // prints email value properly...
                                if(clienEmail!=null){
                                inc.C__FKClient__r.email = clienEmail;  // getting error for this field
                                }

How to assign email value .. ??
 
UjwalaUjwala
Sorry in above code i initialised inc variable as  inc=new incident__c();