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
bbrown1.387768709100204E12bbrown1.387768709100204E12 

This piece of code returns XXXXX(Name). I want to remove "(Name)" from the string.

This piece of code returns XXXXX(Name).

{!$ObjectType[artType].fields[SUBSTITUTE(field,'__s', '__Name__s')].Label}

It is part of this pageBlockSection

<apex:pageBlockSectionItem rendered="{!CONTAINS(field,'__s')}">
        {!$ObjectType[artType].fields[SUBSTITUTE(field,'__s', '__Name__s')].Label}
         <apex:outputLink value="{!URLFOR($Action[artType].FileFieldDownload, article['id'],
                     ['field'=$ObjectType[artType].fields[SUBSTITUTE(field,'__s', '__Body__s')].name])}">{!article[SUBSTITUTE(field,'__s', '__Name__s')]}              </apex:outputLink>
</apex:pageBlockSectionItem>

I want to strip out "(Name)" from the string. How can I do that?
Best Answer chosen by bbrown1.387768709100204E12
GlynAGlynA
Try:

{!SUBSTITUTE($ObjectType[artType].fields[SUBSTITUTE(field,'__s', '__Name__s')].Label,'(Name)','')}

-Glyn

All Answers

Niket SFNiket SF
If it works it awesome. Or we can use Jquery or java Script here ?
GlynAGlynA
Try:

{!SUBSTITUTE($ObjectType[artType].fields[SUBSTITUTE(field,'__s', '__Name__s')].Label,'(Name)','')}

-Glyn
This was selected as the best answer
bbrown1.387768709100204E12bbrown1.387768709100204E12
I knew it had to have something to do with Substitute. I just was using the wrong syntax. Thanks for the answer. It worked great