0

I have created formula field name display eFile which creates a dynamic url for each eFile Number

HYPERLINK("https://abc-communityabc.cs93.force.com/cs/s/case/"+Id+"/detail",""+CaseNumber)

eFile.js

 handleFetchSelectFieldToDisplay(temp)
    {
this.isLoading = true;
this.columns = [];
this.selectedFields =[];
 fetch_Select_Fields_To_Display({
    ListViewId : temp
        }).then(data=>{
    if(data)
    {
        this.columns = this.emptyArray;
        console.log('lv name ----' + this.selectedItemValue + 'lv Id ----' + this.selecte+'---Columns = ' + JSON.stringify(data));
        this.columns = [];
       for(let key in data) 
       {
            if(key==='eFile Number')
            {
                this.columns.push({label: 'Case Number', fieldName: 'DisplayeFile__c', type: 'url',sortable: true,typeAttributes: {label: { fieldName: 'CaseNumber'}}});
            }
            else{
            
                this.columns.push({label: key , fieldName: data[key],sortable:true,filterable:true});                                   
            }
            
    }
    for(let key in data)
    {
        this.selectedFields = Object.keys(data);


    }
    
    this.columns.push({type : 'action',
    typeAttributes :{
        rowActions : actions,
        menuAlignment : 'right'
    }});
console.log('Selected values - '+JSON.stringify(this.selectedFields));
this.handlefetcheFiles(temp);
    }
}).catch(error=>{
    this.dispatchEvent(
        new ShowToastEvent({
            title: 'Error!!'+error.message,
            message: '',
            variant: 'error',
        }),
    );
})





 }

Apex code

       List<Case> cList = new List<Case>();
                 Query = 'Select DisplayeFile__c,Id,'+fieldsToDisplay+' From Case where ' + 
                    propertyIds+'  AND  '+filter ;
                   cList = Database.query(Query);
                   return cList;

Not geting eFile Number field in blue color and the url is not getting correct

Not getting eFile Number field in blue color and the url is not getting correct.

on click of eFile number getting below url in which unnecessary some extra code is concatenated

%3Ca%20href%3D%22https//abc-communityabc.cs93.force.com/cs/s/case/5004F00000AbruD/detail"%20target%3D"_blank">00565777</a>

for security purpose i had added abc instead of organization-name so

2
  • this.columns.push({label: 'Case Number', fieldName: 'DisplayeFile__c', type: 'url',sortable: true,typeAttributes: {label: { fieldName: 'CaseNumber'}}}); add other attributes as well like in target = values of formula field Apr 27, 2020 at 7:21
  • can you tell me one example Apr 27, 2020 at 7:24

1 Answer 1

0

You need to have that column with type : url . Refer the playground with a working example https://developer.salesforce.com/docs/component-library/tools/playground/kPSqiPxWk/12/edit

1
  • I got the solution actually my formula is wrong i used these formula and now it is working correct LEFT($Api.Partner_Server_URL_260, FIND( '/services', $Api.Partner_Server_URL_260)) + 's/detail/' + Id But now the case number is not in blue color so please tell me how to make that field in blue color Apr 27, 2020 at 7:38

You must log in to answer this question.

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