0

Have a text field 'Summary' with ids as values and Summary1 with names as values

Summary = a00o0000001Lgmb,a00o0000001LZRN,a00o0000001id76

Summary1=new product,product1,product2

Have created a formula field 'new' which displays the values of the Summary1 field as hyperlink but when clicked it redirects to the record by the record ids in the Summary field. But this formula is not working correctly. I Want to map each Summary1 value with Summary value ie each name value with id value seperated by comma. Want to display the formula field as

new= new product,product1,product test (but with hyperlinks and when clicked redirects to the url/recordid)

Now the problem is the values dont get detect the Commas.It displays like

new=new product, duct1,duct test, product1 Please help.

(HYPERLINK("url/"&LEFT(Summary,15),LEFT(Summary1__c,FIND(",", Summary1__c,0)-1)))&(',')&

(HYPERLINK("url/"&RIGHT(Summary,15),RIGHT(Summary1__c,FIND(",", Summary1__c,1)+1)))&(',')&

(HYPERLINK("url/"&MID(Summary,17,15),MID(Summary1__c,FIND(",", Summary1__c,2)+1,8)))

1
  • the way to debug this problem is to create intermediate formula fields for each of your expressions - especially the FIND, MID, LEFT, and RIGHT expressions and debug from the bottom up. Expose the intermediate formula field on your page layout while debugging, then remove after you find the issue
    – cropredy
    Dec 13, 2014 at 1:21

2 Answers 2

0

Your formulas appear to be working fine, I added the 3 fields to my dev org and tested out your formula and it worked fine, one thing I noticed is that you have the field Summary without the "__c" but I'm guessing you just missed that when asking the question. Attached is a screenshot of the result:
Edit: I didn't look closely at the formula but I now see the problem and have a corrected formula below:

(HYPERLINK("url/"&LEFT(jjb__Summary__c,15),LEFT(jjb__Summary1__c,FIND(",", jjb__Summary1__c)-1)))&

(HYPERLINK("url/"&RIGHT(jjb__Summary__c,15),RIGHT(jjb__Summary1__c,FIND(",", jjb__Summary1__c)+1)))&

(HYPERLINK("url/"&MID(jjb__Summary__c,17,15),MID(jjb__Summary1__c, FIND(",", jjb__Summary1__c), 
FIND(",", jjb__Summary1__c, FIND(",", jjb__Summary1__c)+1)- FIND(",", jjb__Summary1__c))))

The 3rd parameter of the FIND is which character to start the search at within the string so in order to get the middle I used the second comma and subtracted the location of the first comma to get the number of characters to retrieve from the middle. You previously had it hardcoded to 8 characters.

results

2
  • Incase i change the summary1 field values to Product rcs/dcs, product planning solutions, Product verification. It doesn not display the result properly. Then the new field values are like: Product rcs/dcs,duct verification,product
    – Sfdcas
    Dec 13, 2014 at 0:54
  • @Sfdcas I updated my answer with a new formula.
    – Jenny B
    Dec 13, 2014 at 1:46
0

I think it will be far easier if you can embed a VF page within your detail page. You can then split the values with commas in your apex controller and display an apex:outputLink.

1
  • This is the standard page of the Article management tab. I am not sure if you can embed a visualforce page for Article types .
    – Sfdcas
    Dec 13, 2014 at 0:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .