Newbie Question -
I am trying to write a trigger which creates a new task when the Contract is saved.
In the task I need to populate the Sales_Name__c field with the value from the contract field Sales_Rep_c.
I am getting a compile error indicating an invalid foreign key relationship for c.Sales_Rep_c.
Here is the line generating the error;
Sales_Name__c = [SELECT Name From User Where Id = : c.Sales_Rep_c.id];
If I look at the properties of the Contract field Sales_rep_c it is a reference(custom) with foreign key Sales_rep_r
The Contract field Sales_Rep_c is populated with the correct id value for the user name.