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
Suchitra BSuchitra B 

I have a joint Membership and need the secondary member name to reflect on the Primary Membership how to do that

SwethaSwetha (Salesforce Developers) 
HI Suchitra,
Can you provide more details on your ask. Is there a custom code involved? 

Thanks
Jaya Karthik  karnatiJaya Karthik karnati
hi Suchitra,

You can use a trigger to solve your issue , i am assuming both the primary member and secondary member are linked via look up .

Trigger code.
trigger CopyNameField on Membership(before insert, before update) {
list<Membership> memberstoUpd = new List<Membership>();
for(Membership mb:Trigger.New){
    if(mb.Parent_Membership__c != null && mb.Name== null){
         memebership mba;
         mba.Secondary_Name__C=mb.Name;
         mba.id=mb.Parent_Membership__c;
        memberstoUpd.add(mba);
        }
    }
update memberstoUpd;
}

Hope it helps.

Thanks,
Karthik
Suchitra BSuchitra B
No there is no code involved
 
Suchitra BSuchitra B
Hi Karthik Thanks for the update . I tried the above Apex trigger but is throwing some errorsUser-added image
Suchitra BSuchitra B
Also just to add on Ive a realted list on the primary membership 

User-added image
Suchitra BSuchitra B
All I want is get the joint secondary membership name on the Primary membership