I am working on one trigger where I need to concatinate two fields and populate in third field.
On hed__Course_Offering__c object, I want to concatinate hed__Course__c and hed__Term__c field and need to populate on Name field. I tried below trigger.
trigger ModuleOfferingName on hed__Course_Offering__c (before insert) {
List<hed__Course_Offering__c> con = [select Id,hed__Course__r.Name from hed__Course_Offering__C];
for(hed__Course_Offering__c con : trigger.New){
string nameupd = '';
nameupd += con.hed__Course__c +','+ con.hed__Term__c ;
con.Name = nameupd;}}
The issue is its populating but the hed__Course__c and hed__Term__c are lookup fields so its populating ids but I want names to populate. Can anyone help me out in this issue please.