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
dfalsodfalso 

Problem with related list custom layout - Custom Object Label Name

Hi all, here's my problem:

I've got two custom objects (Grants__c and Addresses__c), which are many-to-many related. So I've built a junction object (GrantAddressBridge__c) with master-detail to both. I want to include the Addresses as a related list on the Grants page, but do NOT want to show the label name of the record of the junction object, just the name(s) of the Address(es). I do, however, want to have the Delete action delete from the junction object (obviously). 

 

It looks like, even though I'm creating this in a custom VF page, the related list inherits it's layout from the current page layout of the object. So I tried to edit the layout of the related list to remove the junction label name and get this error:

 

 

 Custom Object Label Name cannot be removed and must be the first field in the related list.

 
[I have another situation exactly like this that I coded about 6 months ago, and it doesn't have the custom object label name, so I assume the old layout editor allowed this and it was grandfathered in or something]
 
OK, so I need to manually create a related list-style pageblock. I'm running into problems recreating the delete action. I'm currently trying this:

  

<apex:outputLink value="{!URLFOR($Action.GrantAddressBridge__c.delete, Grant__c.id)}" onclick="return window.confirm('Are you sure?');">Del</apex:outputLink>

 

The problem is that it doesn't produce the correct return URL, as I want it to return to the current Grant page. Has anyone done anything like this (creating a related list manually), and if so, how did you address this piece?

 

Thanks much for any help.